Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
istd::IChangeable Class Reference

Common interface for data model objects, which can be changed. More...

#include <IChangeable.h>

Inheritance diagram for istd::IChangeable:
istd::IPolymorphic i2d::CSplineSegment i2d::ICalibrationProvider i2d::IMultiCalibrationProvider iattr::IAttributeMetaInfo iattr::IAttributesMetaInfoProvider iattr::IAttributesProvider ibase::CDelegatedProgressManager ibase::ICommandsProvider ibase::IObjectQueue ibase::IRuntimeStatusProvider icomp::IComponentListProvider icomp::IPackagesManager idoc::IDocumentManager idoc::IDocumentMetaInfo idoc::IDocumentStateComparator idoc::IMultiPageDocument idoc::IMultiPageDocumentProvider ifile::IFileListProvider ifile::IFileResourcesManager ifile::IFileSystemInfoProvider iimg::IBitmapProvider iimg::IMultiBitmapProvider imath::TISampledFunction< ArgumentDimensions, ResultDimensions > iprm::IOptionsList iqtgui::IMultiVisualStatusProvider iqtgui::IVisualStatus iqtgui::IVisualStatusProvider iser::ISerializable iser::IVersionInfo istd::IChangeDelegator istd::IContainerInfo istd::IInformationProvider istd::ITimeStamp iview::IRuler iview::IShapeStatusInfo iview::IVisualCalibrationInfo

Classes

class  ChangeSet
 Set of change flags (its IDs). More...
 

Public Types

enum  ChangeFlags {
  CF_ACF_INTERNAL = 0, CF_ALL_DATA, CF_ANY, CF_DESTROYING,
  CF_DELEGATED, CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0, SO_OBSERVE = 1 << 0, SO_COPY = 1 << 1, SO_CLONE = 1 << 2,
  SO_COMPARE = 1 << 3, SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT, CM_WITHOUT_REFS, CM_WITH_REFS, CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 

Public Member Functions

virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object. More...
 
virtual IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state. More...
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction. More...
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction. More...
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes. More...
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Static Public Member Functions

static const ChangeSetGetNoChanges ()
 Get empty set of changes. More...
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set. More...
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set. More...
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set. More...
 

Protected Member Functions

virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event. More...
 

Detailed Description

Common interface for data model objects, which can be changed.

Data model changes are executed in two steps: begin and end. The caller can also put some flags and additional data to the update functions, to control the update logic.

Definition at line 24 of file IChangeable.h.

Member Enumeration Documentation

Data model change notification flags.

Enumerator
CF_ACF_INTERNAL 

Internal ACF flag.

Indicate that internal update is done.

CF_ALL_DATA 

All object data are changed.

CF_ANY 

Indicate anonymous change.

CF_DESTROYING 

Change flag indicate that model is during destruction.

CF_DELEGATED 

Change flag indicate that this change was delegated (is indirect) for example from aggregated object.

CF_NO_UNDO 

Used to avoid adding of changes to undo list.

Definition at line 111 of file IChangeable.h.

Control how relationship betweeen objects are interpreted.

It is also used to define how objects are copied.

Enumerator
CM_STRICT 

If external references are different this object are not compatible and cannot be compared or copied.

Copy without references to external objects only if objects are compatible.

CM_WITHOUT_REFS 

External references are simple ignored.

Copy without references to external objects.

CM_WITH_REFS 

External references are part of object integrity.

For comparation external references must be equal, for copy operations they will be copied.

CM_CONVERT 

Data of object are interpreted in context of external references.

For comparation the meaning of object (e.g. after transformation using externals) will be compared. Copying will converting the data to be compatible according to existing references to external objects.

Definition at line 186 of file IChangeable.h.

Flags for supported operations.

This flags can be combined.

Enumerator
SO_NONE 

No operations are supported.

SO_OBSERVE 

Observing of this object via observer-observable pattern.

SO_COPY 

Copying from other object.

SO_CLONE 

Creating of copy of this object.

SO_COMPARE 

Comparison with another object.

SO_RESET 

Resetting of object state.

Definition at line 149 of file IChangeable.h.

Member Function Documentation

void istd::IChangeable::BeginChangeGroup ( const ChangeSet changeSet)
inlinevirtual

Starts group of changes.

It doesn't start signaling of changes, it allows simply to group set of changes into single transaction block.

Note
It should be never called or override by user.
See Also
EndChangeGroup()

Reimplemented in imod::TModelWrap< iimg::CBitmap >, imod::TModelWrap< iqtgui::CGuiComponentBase::VisualStatus >, imod::TModelWrap< iprm::CEnableableParam >, imod::TModelWrap< iprm::CParamsManagerCompBase::SelectedParams >, and imod::TModelWrap< ibase::ICommandsProvider >.

Definition at line 361 of file IChangeable.h.

Referenced by istd::CChangeGroup::CChangeGroup().

void istd::IChangeable::BeginChanges ( const ChangeSet changeSet)
inlinevirtual
IChangeable * istd::IChangeable::CloneMe ( CompatibilityMode  mode = CM_WITHOUT_REFS) const
inlinevirtual
bool istd::IChangeable::CopyFrom ( const IChangeable object,
CompatibilityMode  mode = CM_WITHOUT_REFS 
)
inlinevirtual
void istd::IChangeable::EndChangeGroup ( const ChangeSet changeSet)
inlinevirtual

Ends group of changes.

It doesn't start signaling of changes, it allows simply to group set of changes into single transaction block.

Note
It should be never called or override by user.
See Also
BeginChangeGroup

Reimplemented in imod::TModelWrap< iimg::CBitmap >, imod::TModelWrap< iqtgui::CGuiComponentBase::VisualStatus >, imod::TModelWrap< iprm::CEnableableParam >, imod::TModelWrap< iprm::CParamsManagerCompBase::SelectedParams >, and imod::TModelWrap< ibase::ICommandsProvider >.

Definition at line 366 of file IChangeable.h.

Referenced by istd::CChangeGroup::~CChangeGroup().

void istd::IChangeable::EndChanges ( const ChangeSet changeSet)
inlinevirtual

Ends the change transaction.

Note
It should be never override called or by user. Please use OnEndChanges instead.
Parameters
changeSetset of IDs used to identify what kind of change was done. for the empty set you can assume, that no change was done.
See Also
BeginChanges

Reimplemented in imod::TModelWrap< iimg::CBitmap >, imod::TModelWrap< iqtgui::CGuiComponentBase::VisualStatus >, imod::TModelWrap< iprm::CEnableableParam >, imod::TModelWrap< iprm::CParamsManagerCompBase::SelectedParams >, imod::TModelWrap< ibase::ICommandsProvider >, istd::TCachedUpdateManagerWrap< iser::ISerializable >, and istd::TCachedUpdateManagerWrap< iimg::CGeneralBitmap >.

Definition at line 355 of file IChangeable.h.

References OnEndChanges().

Referenced by istd::CChangeNotifier::~CChangeNotifier().

const IChangeable::ChangeSet & istd::IChangeable::GetAllChanges ( )
inlinestatic

Get anonymous change set.

Definition at line 387 of file IChangeable.h.

Referenced by ibase::TFactorisableContainer< InterfaceClass >::Serialize().

const IChangeable::ChangeSet & istd::IChangeable::GetAnyChange ( )
inlinestatic

Get anonymous change set.

Definition at line 381 of file IChangeable.h.

const IChangeable::ChangeSet & istd::IChangeable::GetDelegatedChanges ( )
inlinestatic

Get delegated change set.

Definition at line 393 of file IChangeable.h.

const IChangeable::ChangeSet & istd::IChangeable::GetNoChanges ( )
inlinestatic

Get empty set of changes.

Definition at line 375 of file IChangeable.h.

int istd::IChangeable::GetSupportedOperations ( ) const
inlinevirtual
bool istd::IChangeable::IsEqual ( const IChangeable object) const
inlinevirtual
void istd::IChangeable::OnBeginChanges ( )
inlineprotectedvirtual

Callback function for begin change event.

Please note, that in some cases no following OnEndChanges can be called.

Reimplemented in istd::TChangeDelegator< Base >, istd::TChangeDelegator< IHierarchicalMessageContainer >, istd::TChangeDelegator< ibase::IHierarchicalCommand >, and istd::CChangeDelegator.

Definition at line 401 of file IChangeable.h.

Referenced by BeginChanges().

void istd::IChangeable::OnEndChanges ( const ChangeSet changeSet)
inlineprotectedvirtual
bool istd::IChangeable::ResetData ( CompatibilityMode  mode = CM_WITHOUT_REFS)
inlinevirtual

Reset data to its default state.

Default implementation in istd::IChangeable does nothing.

Returns
true if the operation was successful, and false otherwise.

Reimplemented in iimg::CScanlineMask, ilog::CMessageContainer, iprm::CParamsSet, idoc::TMultiPageDocumentWrap< Base >, idoc::TMultiPageDocumentWrap< idoc::IMultiPageDocument >, iimg::CMultiPageBitmapBase, i2d::CObject2dBase, iimg::CBitmapBase, and i2d::CAnnulusComp.

Definition at line 343 of file IChangeable.h.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy