OMK::Iii::InteractorOutput Class Reference
[Interactor]

This class defines informations about interactor output. More...

#include <OMKInteractorOutput.h>

Inheritance diagram for OMK::Iii::InteractorOutput:

Inheritance graph
[legend]
Collaboration diagram for OMK::Iii::InteractorOutput:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~InteractorOutput ()
virtual const Nameid () const
 Get the id of the associated attribute.
const Namecategory () const
 Get the category id of the interactor output.
const Nametype () const
 Get the type id of the interactor output.
const OMK::Type::AccessGroupLevelgetAccessGroup () 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.

Detailed Description

This class defines informations about interactor output.

Author:
Benoît Chanclou
Date:
2006/06/15
It is a part of the interaction protocol.

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.


Constructor & Destructor Documentation

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]

Definition at line 64 of file OMKInteractorOutput.h.

00064 {}


Member Function Documentation

virtual const Name& OMK::Iii::InteractorOutput::id (  )  const [inline, virtual]

Get the id of the associated attribute.

Returns:
the id of the associated attribute, see _id.

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.

Returns:
the category of the interactor output, see _category.

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.

Returns:
the type of the interactor output, see _type.

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.

Returns:
the access control setting, see _accessGroup.

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.

Parameters:
[in] accessGroup the new settings, see _accessGroup.
Change the connected connectors according to the settings.

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.

Parameters:
[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.
Returns:
true if the parameters can be loaded.
Creates a interactor output and adds it to the InteractorExtension.

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.

Parameters:
[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.
Creates an interactor output and adds it to the InteractorExtension.

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 }


Member Data Documentation

Name OMK::Iii::InteractorOutput::_id [protected]

The id of the associated output.

Definition at line 117 of file OMKInteractorOutput.h.

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.

OMK::Type::AccessGroupLevel OMK::Iii::InteractorOutput::_accessGroup [protected]

Group setting which indicates how the interactor change the access to the connector.

Definition at line 129 of file OMKInteractorOutput.h.

Referenced by setAccessGroup().

InteractorExtension* OMK::Iii::InteractorOutput::_interactor [protected]

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().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:04 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007