#include <OMKInteractorOutput.h>
Inheritance diagram for OMK::Iii::InteractorOutput:
Public Member Functions | |
virtual | ~InteractorOutput () |
virtual const Name & | id () const |
Get the id of the associated attribute. | |
const Name & | category () const |
Get the category id of the interactor output. | |
const Name & | type () const |
Get the type id of the interactor output. | |
const OMK::Type::AccessGroupLevel & | getAccessGroup () const |
Get the new definition of the access control setting for the connector. | |
void | setAccessGroup (const OMK::Type::AccessGroupLevel &accessGroup) |
Change access settings of the interactor output. | |
Static Public Member Functions | |
static bool | create (const Name &id, InteractorExtension *interactor, const ConfigurationParameterDescriptor *node) |
Creates a interactor output. | |
static void | create (const Name &id, const Name &attributeId, InteractorExtension *interactor, const Name &category, const OMK::Type::AccessGroupLevel &accessGroup, bool setByEvent) |
Creates an interactor output. | |
Protected Member Functions | |
InteractorOutput (const Name &id, InteractorExtension *interactor, const Name &category, const Name &type) | |
Protected Attributes | |
Attributes | |
Name | _id |
The id of the associated output. | |
Name | _category |
Category id of the output. | |
Name | _type |
Type id of the connection. | |
OMK::Type::AccessGroupLevel | _accessGroup |
Group setting which indicates how the interactor change the access to the connector. | |
InteractorExtension * | _interactor |
Reference to the interactor extension. |
The aim of this class is to store the informations of the interactor output: id, category id, type and access group setting.
The main job is done by the create static method.
Definition at line 59 of file OMKInteractorOutput.h.
InteractorOutput::InteractorOutput | ( | const Name & | id, | |
InteractorExtension * | interactor, | |||
const Name & | category, | |||
const Name & | type | |||
) | [protected] |
Definition at line 36 of file OMKInteractorOutput.cpp.
00038 : _id( id ), 00039 _category( category ), 00040 _type( type ), 00041 _interactor( interactor ) 00042 { 00043 }
virtual OMK::Iii::InteractorOutput::~InteractorOutput | ( | ) | [inline, virtual] |
virtual const Name& OMK::Iii::InteractorOutput::id | ( | ) | const [inline, virtual] |
Get the id of the associated attribute.
Definition at line 67 of file OMKInteractorOutput.h.
00067 { return _id ; }
const Name& OMK::Iii::InteractorOutput::category | ( | ) | const [inline] |
Get the category id of the interactor output.
Definition at line 70 of file OMKInteractorOutput.h.
Referenced by OMK::Iii::InteractorExtension::addInteractorOutput(), and create().
00070 { return _category ; }
const Name& OMK::Iii::InteractorOutput::type | ( | ) | const [inline] |
Get the type id of the interactor output.
Definition at line 73 of file OMKInteractorOutput.h.
Referenced by OMK::Iii::InteractorExtension::addInteractorOutput().
00073 { return _type ; }
const OMK::Type::AccessGroupLevel& OMK::Iii::InteractorOutput::getAccessGroup | ( | ) | const [inline] |
Get the new definition of the access control setting for the connector.
Definition at line 76 of file OMKInteractorOutput.h.
00076 { return _accessGroup ; }
void InteractorOutput::setAccessGroup | ( | const OMK::Type::AccessGroupLevel & | accessGroup | ) |
Change access settings of the interactor output.
[in] | accessGroup | the new settings, see _accessGroup. |
Definition at line 45 of file OMKInteractorOutput.cpp.
References _accessGroup.
Referenced by create().
00046 { 00047 if( accessGroup.empty() ) 00048 { 00049 _accessGroup.clear() ; 00050 _accessGroup[ "*" ] = -1 ; 00051 } 00052 else 00053 { 00054 _accessGroup = accessGroup ; 00055 } 00056 }
bool InteractorOutput::create | ( | const Name & | id, | |
InteractorExtension * | interactor, | |||
const ConfigurationParameterDescriptor * | node | |||
) | [static] |
Creates a interactor output.
[in] | id | The id of the associated output of the interactor object. |
[in] | interactor | The interactor extension. |
[in] | node | The configuration node where to find informations. |
It also activates the set by event feature of the attribute to allow the initialisation.
Definition at line 58 of file OMKInteractorOutput.cpp.
References category(), and OMK::ParametersAccessor::get().
Referenced by OMK::Iii::JointInteractorExtension::loadExtensionParameters(), and OMK::Iii::InteractorExtension::loadExtensionParameters().
00061 { 00062 // try to loads parameters 00063 Name category( "undefined" ) ; 00064 bool exclusive = false ; 00065 Name attributeId( id ) ; 00066 AccessGroupLevel accessGroup ; 00067 bool ok = ParametersAccessor::get( node, "Category", category ) ; 00068 ParametersAccessor::get( node, "AttributeId", attributeId ) ; 00069 ParametersAccessor::get( node, "AccessSetting", accessGroup ) ; 00070 if( ok ) create( id, attributeId, extension, category, accessGroup, true ) ; 00071 return ok ; 00072 }
void InteractorOutput::create | ( | const Name & | id, | |
const Name & | attributeId, | |||
InteractorExtension * | interactor, | |||
const Name & | category, | |||
const OMK::Type::AccessGroupLevel & | accessGroup, | |||
bool | setByEvent | |||
) | [static] |
Creates an interactor output.
[in] | id | The id of the associated output of the interactor object. |
[in] | interactor | The interactor extension. |
[in] | atttributeId | The id of the associated attribute. |
[in] | category | The category of the output. |
[in] | accessGroup | The access settings of the connector. |
[in] | setByEvent | flag to activate the set by event to update the interactor through a "get current values" event. |
Definition at line 74 of file OMKInteractorOutput.cpp.
References OMK::Iii::InteractorExtension::addInteractorOutput(), category(), OMK::debugMsg(), OMK::ExtensibleSimulatedObject::getAttribute(), OMK::Iii::InteractorExtension::getInteractor(), OMK::IAttribute::getTypes(), OMK_DEBUG_III, OMTRACEID, and setAccessGroup().
00080 { 00081 ExtensibleSimulatedObject* owner = interactor->getInteractor() ; 00082 // try to find the associated output 00083 IAttribute* attribute = owner->getAttribute( id ) ; 00084 if( attribute ) 00085 { 00086 // Creates the interactor output 00087 InteractorOutput *interactorOutput = InteractorOutputFactory::getInstance().create( owner->getAttribute( id )->getTypes() ) 00088 ( id, atttributeId, interactor, category, setByEvent ) ; 00089 // Adds it to the listener which will store and manage it 00090 interactor->addInteractorOutput( interactorOutput ) ; 00091 // Set the access group settings 00092 interactorOutput->setAccessGroup( accessGroup ) ; 00093 00094 OMTRACEID( OMK_DEBUG_III, "Information for " << OMK::debugMsg( interactor, owner ) << std::endl 00095 << ">>> Create the interactor output for \"" << id << "\" category \"" << interactorOutput->category() << "\"" ) ; 00096 } 00097 else 00098 { 00099 OMTRACEID( OMK_DEBUG_III, ":-( Error for " << OMK::debugMsg( interactor, owner ) << std::endl 00100 << ">>> Unable to create the interactor output for \"" << id << "\" because this attribute doesn't exist !" ) ; 00101 } 00102 }
Name OMK::Iii::InteractorOutput::_id [protected] |
Name OMK::Iii::InteractorOutput::_category [protected] |
Category id of the output.
This id define the category for the output and identifies the parameter category. The interactors know the parameter category thanks to this id. It is defined at the creation of the interactor output and cannot be changed during its life.
Definition at line 123 of file OMKInteractorOutput.h.
Name OMK::Iii::InteractorOutput::_type [protected] |
Type id of the connection.
This id defines the type of the connector and identifies it. It is defined at the creation of the connector and cannot be changed during its life.
Definition at line 127 of file OMKInteractorOutput.h.
Group setting which indicates how the interactor change the access to the connector.
Definition at line 129 of file OMKInteractorOutput.h.
Referenced by setAccessGroup().
Reference to the interactor extension.
Definition at line 131 of file OMKInteractorOutput.h.
Referenced by OMK::Iii::InteractorOutputT< PrmType, ModelType >::InteractorOutputT(), and OMK::Iii::InteractorOutputT< PrmType, ModelType >::processSetValue().
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |