API Guides > ConceptRT 3.x
Persistent< DataType > Class Template Reference

Persistent container class More...

Detailed Description

template<class DataType>
class ConceptRT::Persistent< DataType >

Persistent container class

Template Parameters
DataTypeType of the persistent value.
Note
As Persistents works with Service, ConceptRTComponentsInitialize() must be call at the beginning of the application in order to start the mechanism.
+ Inheritance diagram for Persistent< DataType >:

Public Member Methods

bool Define (PCChar8 persistentName)
 Define the persistent. More...
 
bool Define (PCChar8 persistentName, const DataType &defaultValue)
 Define the persistent. More...
 
- Public Member Methods inherited from Persistent__< DataType >
DataType ReadLocked ()
 Reads the persistent value. More...
 
void WriteLocked (const DataType &value)
 Writes the persistent value. More...
 
- Public Member Methods inherited from BasePersistent
void Lock ()
 Locks this object. More...
 
void Unlock ()
 Unlocks this object. More...
 
void NotifyChange ()
 Notify that the persistent value has changed. More...
 
const StringGetPersistentName () const
 Gets the peristent file name . More...
 
String GetPersistentFilePath () const
 Gets the peristent file path . More...
 
bool GetDefined () const
 Query if the persistent has been defined . More...
 
Int32 GetPersistentIdentifier () const
 Gets the persistent auto identifier. More...
 
void Invoke (const DynamicInvocationRequest &request, DynamicInvocationResult &result)
 Invokes the object fields and methods. More...
 
bool HasChanged () const
 Query if the persistent has been changed. More...
 
- Public Member Methods inherited from Service< BasePersistent, PriorityBelowNormal >
 Service ()
 Constuctor. More...
 
virtual ~Service ()
 Destructor. More...
 
- Public Member Methods inherited from BaseService
 BaseService (BaseServiceController &serviceController)
 Constuctor. More...
 
void SetPeriod (TimeSpan period)
 Set the period of the service. More...
 
TimeSpan GetPeriod () const
 Gets the service period. More...
 

Additional Inherited Members

- Public Attributes inherited from Persistent__< DataType >
DataType _Value_Unlocked
 The persistent unlocked value. More...
 
- Protected Member Functions inherited from Persistent__< DataType >
void WriteTo (IDataStore &dataStore) const
 Writes to. More...
 
- Protected Member Functions inherited from BasePersistent
 BasePersistent ()
 Default constructor. More...
 
bool Define (PCChar8 persistentName, bool diagnoseMissingFile)
 Define the persistent. More...
 
void CyclicExecute ()
 Cyclic execution of the service. More...
 
void FinalExecute ()
 Final execution of the service. More...
 
- Protected Member Functions inherited from BaseService
virtual void InitialExecute ()
 Initial execution of the service. More...
 
void UnregisterServiceController ()
 Method used by inherited class to unregister the service controller. More...
 
void RegisterServiceController ()
 Method used by inherited class to register the service controller once completely created. More...
 

Methods Documentation

bool Define ( PCChar8  persistentName)
inline

Define the persistent.

Parameters
persistentNameName of the persistent. Should be unique!
Returns
true if properly loaded, false if not. If not the persistent value is undefined.

Use PersistenceDiagnostic in case of false return.

bool Define ( PCChar8  persistentName,
const DataType &  defaultValue 
)
inline

Define the persistent.

Parameters
persistentNameName of the persistent. Should be unique!
defaultValueDefault persistent value.
Returns
true if properly loaded, false if not. If not the default value is used.

Use PersistenceDiagnostic in case of false return.