ProteoWizard
Public Member Functions | Public Attributes | Private Attributes | List of all members
pwiz::data::Diff< object_type, config_type, object_result_type > Struct Template Reference

Calculate diffs of objects in a ProteoWizard data model hierarchy. More...

#include <diff_std.hpp>

Public Member Functions

 Diff (const config_type &config=config_type())
 
 Diff (const object_type &a, const object_type &b, const config_type &config=config_type())
 
 operator bool ()
 conversion to bool, with same semantics as *nix diff command: true == different false == not different More...
 
Diffoperator() (const object_type &a, const object_type &b)
 

Public Attributes

object_result_type a_b
 
object_result_type b_a
 

Private Attributes

config_type config_
 

Detailed Description

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
struct pwiz::data::Diff< object_type, config_type, object_result_type >

Calculate diffs of objects in a ProteoWizard data model hierarchy.

A diff between two objects a and b calculates the set differences aand b.

The Diff struct acts as a functor, but also stores the results of the diff calculation.

The bool conversion operator is provided to indicate whether the two objects are different (either aor bis non-empty).

object_type requirements: object_type a; a.empty(); pwiz::data::diff::diff(const object_type& a, const object_type& b, object_result_type& a_b, object_result_type& b_a);

config_type must be pwiz::data::diff::BaseDiffConfig or derived from it

Definition at line 142 of file diff_std.hpp.

Constructor & Destructor Documentation

§ Diff() [1/2]

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
pwiz::data::Diff< object_type, config_type, object_result_type >::Diff ( const config_type &  config = config_type())
inline

Definition at line 144 of file diff_std.hpp.

145  : config_(config)
146  {}
config_type config_
Definition: diff_std.hpp:172

§ Diff() [2/2]

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
pwiz::data::Diff< object_type, config_type, object_result_type >::Diff ( const object_type &  a,
const object_type &  b,
const config_type &  config = config_type() 
)
inline

Definition at line 148 of file diff_std.hpp.

References pwiz::data::diff_impl::diff().

151  : config_(config)
152  {
153  diff_impl::diff(a, b, a_b, b_a, config_);
154  }
config_type config_
Definition: diff_std.hpp:172
object_result_type b_a
Definition: diff_std.hpp:157
object_result_type a_b
Definition: diff_std.hpp:156
PWIZ_API_DECL void diff(const std::string &a, const std::string &b, std::string &a_b, std::string &b_a, const BaseDiffConfig &config)

Member Function Documentation

§ operator bool()

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
pwiz::data::Diff< object_type, config_type, object_result_type >::operator bool ( )
inline

conversion to bool, with same semantics as *nix diff command: true == different false == not different

Definition at line 162 of file diff_std.hpp.

162 {return !(a_b.empty() && b_a.empty());}
object_result_type b_a
Definition: diff_std.hpp:157
object_result_type a_b
Definition: diff_std.hpp:156

§ operator()()

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
Diff& pwiz::data::Diff< object_type, config_type, object_result_type >::operator() ( const object_type &  a,
const object_type &  b 
)
inline

Definition at line 164 of file diff_std.hpp.

References pwiz::data::diff_impl::diff().

166  {
167  diff_impl::diff(a, b, a_b, b_a, config_);
168  return *this;
169  }
config_type config_
Definition: diff_std.hpp:172
object_result_type b_a
Definition: diff_std.hpp:157
object_result_type a_b
Definition: diff_std.hpp:156
PWIZ_API_DECL void diff(const std::string &a, const std::string &b, std::string &a_b, std::string &b_a, const BaseDiffConfig &config)

Member Data Documentation

§ a_b

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
object_result_type pwiz::data::Diff< object_type, config_type, object_result_type >::a_b

§ b_a

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
object_result_type pwiz::data::Diff< object_type, config_type, object_result_type >::b_a

§ config_

template<typename object_type, typename config_type = BaseDiffConfig, typename object_result_type = object_type>
config_type pwiz::data::Diff< object_type, config_type, object_result_type >::config_
private

Definition at line 172 of file diff_std.hpp.


The documentation for this struct was generated from the following file: