C12Adapter Opensource C++ Interface
MCOMObject Class Reference

Root communication object that defines default property handling and configuration location. More...

Inheritance diagram for MCOMObject:

Public Member Functions

virtual MCOMObjectCreateClone () const
 Virtual abstract copy constructor, creates MCOM object.
 
virtual ~MCOMObject ()
 Object destructor.
 
virtual MStdStringVector GetAllPropertyNames () const
 Return the list of publicly available properties in MCOM syntax. More...
 
virtual MStdStringVector GetAllPersistentPropertyNames () const
 Return the list of publicly available persistent properties in MCOM syntax. More...
 
MStdString GetPersistentPropertyValues (bool onlyNondefaults=false, bool excludeSecurityRelated=false) const
 Get the string with the list of persistent property names and their values. More...
 
void SetPersistentPropertyValues (const MStdString &values)
 Set the persistent properties for the object using the string with the following format: More...
 
void SetPropertyValues (const MDictionary &values)
 Set the properties for the object using the property list object. More...
 
virtual void WriteToMonitor (const MStdString &message)
 Synchronously write a message to the monitor, if it is connected. More...
 
void WritePropertiesToMonitor ()
 Write all non-default values of protocol properties into monitor. More...
 
MStdString DoGetPersistentPropertyValues0 () const
 Get the string with the whole list of persistent property names and their values. More...
 
MStdString DoGetPersistentPropertyValues1 (bool onlyNondefaults) const
 Get the string with the list of persistent property names and their values. More...
 
- Public Member Functions inherited from MObject
virtual ~MObject ()
 Object destructor.
 
virtual const MClassGetClass () const =0
 Get the final class of the object. More...
 
virtual unsigned GetEmbeddedSizeof () const
 For embedded object types, return the size of the class. More...
 
bool IsEmbeddedObject () const
 Tell if the object is of embedded kind. More...
 
SHOW_INTERNAL MVariant Call (const MStdString &name, const MVariant &params)
 Call the object service with parameters, given as variant. More...
 
MVariant Call0 (const MStdString &name)
 Call the object service with no parameters. More...
 
MVariant Call1 (const MStdString &name, const MVariant &p1)
 Call the object service with one parameter. More...
 
MVariant Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2)
 Call the object service with two parameter. More...
 
MVariant Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3)
 Call the object service with three parameter. More...
 
MVariant Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4)
 Call the object service with four parameter. More...
 
MVariant Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5)
 Call the object service with five parameter. More...
 
MVariant Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6)
 Call the object service with six parameter. More...
 
virtual MVariant CallV (const MStdString &name, const MVariant::VariantVector &params)
 Call the object service with parameters, given as variant vector. More...
 
virtual bool IsPropertyPresent (const MStdString &name) const
 Tell if the property with the given name exists.
 
virtual bool IsServicePresent (const MStdString &name) const
 Tell if the service with the given name exists.
 
virtual MVariant GetProperty (const MStdString &name) const
 Get the property value using name of the property. More...
 
virtual void SetProperty (const MStdString &name, const MVariant &value)
 Set the property using name of the property, and value. More...
 
virtual void SetPersistentPropertiesToDefault ()
 Set the persistent properties of the object to their default values. More...
 
virtual MVariant GetPersistentPropertyDefaultValue (const MStdString &name) const
 Get the default value of persistent property with the name given. More...
 
virtual void SetPersistentPropertyToDefault (const MStdString &name)
 Set the persistent property with the name given to default value. More...
 
virtual const char * GetType () const
 Get the name of the type for the object (could be the same as class name).
 
virtual void SetType (const MStdString &)
 Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More...
 
virtual void Validate ()
 Validate internal structures of the object. More...
 

Protected Member Functions

 MCOMObject ()
 Object constructor, protected as the class is abstract.
 
- Protected Member Functions inherited from MObject
 MObject ()
 Object constructor, protected as the class is abstract.
 
void DoSetPersistentPropertiesToDefault (const MClass *staticClass)
 Set the persistent properties to their default values for one object provided the class for that object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MObject
static const MClassGetStaticClass ()
 Get the declared class of this particular object. More...
 
static bool IsClassPresent (const MStdString &name)
 Tells if the given class name is available. More...
 
- Static Public Attributes inherited from MObject
static const MClass s_class
 Class of MObject.
 

Detailed Description

Root communication object that defines default property handling and configuration location.

It is also able to stream the persistent properties into string.

There are no new public properties defined within this class, only those which are in MObject.

Member Function Documentation

MStdString MCOMObject::DoGetPersistentPropertyValues0 ( ) const

Get the string with the whole list of persistent property names and their values.

Non-default values and security properties are all included. The string has the following format:

PROPERTY1=value1;PROPERTY2=value2;....

Where PROPERTY1, PROPERTY2, ... are property names, value1, value2 ... are their values. In case the property is of string type, the correspondent value is enclosed in quotes, and it can have C-like escape sequences.

Returns
String representing the values of the properties
MStdString MCOMObject::DoGetPersistentPropertyValues1 ( bool  onlyNondefaults) const

Get the string with the list of persistent property names and their values.

Security properties are included. The string has the following format:

PROPERTY1=value1;PROPERTY2=value2;....

Where PROPERTY1, PROPERTY2, ... are property names, value1, value2 ... are their values. In case the property is of string type, the correspondent value is enclosed in quotes, and it can have C-like escape sequences.

Parameters
onlyNondefaultsIf true, only TYPE and non-default properties are returned.
Returns
String representing the values of the properties.
virtual MStdStringVector MCOMObject::GetAllPersistentPropertyNames ( ) const
virtual

Return the list of publicly available persistent properties in MCOM syntax.

In contrast with the original MCORE implementation, the property names will all be uppercased and name separation will be done with underscores. For all properties, persistent and dynamic, one can use GetAllPropertyNames.

Reimplemented from MObject.

virtual MStdStringVector MCOMObject::GetAllPropertyNames ( ) const
virtual

Return the list of publicly available properties in MCOM syntax.

In contrast with the original MCORE implementation, the property names will all be uppercased and name separation will be done with underscores. For persistent properties, one can use GetAllPersistentPropertyNames.

Reimplemented from MObject.

MStdString MCOMObject::GetPersistentPropertyValues ( bool  onlyNondefaults = false,
bool  excludeSecurityRelated = false 
) const

Get the string with the list of persistent property names and their values.

The string has the following format:

PROPERTY1=value1;PROPERTY2=value2;....

Where PROPERTY1, PROPERTY2, ... are property names, value1, value2 ... are their values. In case the property is of string type, the correspondent value is enclosed in quotes, and it can have C-like escape sequences.

Parameters
onlyNondefaultsIf true, only TYPE and non-default properties are returned.
excludeSecurityRelatedIf true, do not return values of PASSWORD, AUTHENTICATION_KEY and SECURITY_KEY properties if these are present in the protocol.
Returns
String representing the values of the properties.
void MCOMObject::SetPersistentPropertyValues ( const MStdString values)

Set the persistent properties for the object using the string with the following format:

PROPERTY1=value1;PROPERTY2=value2;....

Where PROPERTY1, PROPERTY2, ... are property names, value1, value2 ... are their values.

In case the property is of string type, the correspondent value should be enclosed in quotes, and it can have C-like escape sequences.

The order for the properties is not significant. It is not required that all object properties are present. In case the property is not present, its value will not be changed.

Precondition
The properties mentioned should exist for the object, and the values given to those properties should be valid. No properties in the list can be Get-only. Otherwise this service throws an appropriate exception. Only those properties are set to the object, which were mentioned before the offending property.
void MCOMObject::SetPropertyValues ( const MDictionary values)

Set the properties for the object using the property list object.

The order for the properties is not significant. It is not required that all object properties are present. In case the property is not present, its value will not be changed.

Precondition
The properties mentioned should exist for the object, and the values given to those properties should be valid. No properties in the list can be Get-only. Otherwise this service throws an appropriate exception. In case the exception is thrown, only those properties are set to the object, which were mentioned before the offending property.
void MCOMObject::WritePropertiesToMonitor ( )

Write all non-default values of protocol properties into monitor.

This is a convenience method for all types of troubleshooting. No errors are thrown. If there is no monitor connected, nothing is done.

virtual void MCOMObject::WriteToMonitor ( const MStdString message)
virtual

Synchronously write a message to the monitor, if it is connected.

No error is thrown if the Monitor is not running or the Monitor log file is not accumulating.

Parameters
messageThe message to write to the Monitor and the Monitor log file.

Reimplemented in MProtocol, and MChannel.