fw4spl
fwDataCamp::visitor::CompareObjects Class Reference

Visitor used to compare two objects. More...

#include <CompareObjects.hpp>

+ Inheritance diagram for fwDataCamp::visitor::CompareObjects:
+ Collaboration diagram for fwDataCamp::visitor::CompareObjects:

Public Types

typedef std::map< std::string, std::string > PropsMapType
 Associates property path (within its parent object) to its value.
 

Public Member Functions

FWDATACAMP_API CompareObjects ()
 Constructor.
 
std::shared_ptr< ::fwData::ObjectgetReferenceObject () const
 Returns the reference object.
 
std::shared_ptr< ::fwData::ObjectgetComparedObject () const
 Returns the compared object.
 
const PropsMapTypegetReferenceProps () const
 Returns reference object properties.
 
const PropsMapTypegetComparedProps () const
 Returns compared object properties.
 
std::shared_ptr< PropsMapTypegetDifferences () const
 Returns the differences found between comparison of reference and compared objects. More...
 
FWDATACAMP_API void compare (std::shared_ptr< ::fwData::Object > objRef, std::shared_ptr< ::fwData::Object > objComp)
 Process to the comparison between reference object and compared object. When the process completes, the differences found between the objects are accessible through ComparedObjects.getDifferences(). More...
 
Introspection methods implementation
FWDATACAMP_API void visit (const camp::SimpleProperty &property)
 
FWDATACAMP_API void visit (const camp::EnumProperty &property)
 
FWDATACAMP_API void visit (const camp::UserProperty &property)
 
FWDATACAMP_API void visit (const camp::ArrayProperty &property)
 
FWDATACAMP_API void visit (const camp::Function &function)
 
virtual FWDATACAMP_API void visit (const camp::MapProperty &property)
 
- Public Member Functions inherited from camp::ExtendedClassVisitor
virtual void visit (const Property &property)
 
virtual void visit (const SimpleProperty &property)
 
virtual void visit (const ArrayProperty &property)
 
virtual void visit (const EnumProperty &property)
 
virtual void visit (const UserProperty &property)
 
virtual void visit (const Function &function)
 

Static Public Attributes

static FWDATACAMP_API const std::string s_MISSING_PROPERTY
 Property value for differences map meaning a missing property.
 

Friends

struct PropertyVisitor
 

Detailed Description

Visitor used to compare two objects.

Definition at line 30 of file CompareObjects.hpp.

Member Function Documentation

void fwDataCamp::visitor::CompareObjects::compare ( std::shared_ptr< ::fwData::Object objRef,
std::shared_ptr< ::fwData::Object objComp 
)

Process to the comparison between reference object and compared object. When the process completes, the differences found between the objects are accessible through ComparedObjects.getDifferences().

Parameters
objRefdata object marked as reference object in comparison
objCompdata object marked as compared object to reference object
Returns
a map containing the differences found between objects
Exceptions
fwCore::Exceptionif classnames of reference and compared objects are different

Definition at line 273 of file CompareObjects.cpp.

References fwData::Object::getClassname(), and SLM_ASSERT.

+ Here is the call graph for this function:

std::shared_ptr< PropsMapType > fwDataCamp::visitor::CompareObjects::getDifferences ( ) const
inline

Returns the differences found between comparison of reference and compared objects.

Returns
a map using property path within object as key, and associated value found in compared object as value.

Definition at line 86 of file CompareObjects.hpp.

References SPTR.


The documentation for this class was generated from the following files: