MIRA
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ChannelProperty< T > Class Template Reference

The concrete typed ChannelProperty template class. More...

#include <visualization/ChannelProperty.h>

Inheritance diagram for ChannelProperty< T >:
Inheritance graph
[legend]

Public Member Functions

 ChannelProperty ()
 
virtual bool isValid () const
 Returns true, if an existing channel is set. Must be implemented in derived class. More...
 
virtual uint32 getDataUpdateCount () const
 Returns the number of data updates the channel has received. More...
 
virtual std::list< std::pair< std::string, Typename > > getAvailableChannels ()
 Returns list of (channelID,typename) pairs containing the channels that match the desired type. More...
 
virtual void set (const std::string &id, IAuthorityProvider *authorityProvider)
 Sets the channelID and a necessary authority provider that is used to obtain the authority for subscribing the set channel. More...
 
void setDataChangedCallback (boost::function< void(ChannelRead< T >)> dataChangedFn)
 
template<typename Class >
void setDataChangedCallback (void(Class::*f)(ChannelRead< T >), Class *obj)
 
void setDataIntervalChangedCallback (boost::function< void(ChannelReadInterval< T >)> dataChangedFn)
 
template<typename Class >
void setDataIntervalChangedCallback (void(Class::*f)(ChannelReadInterval< T >), Class *obj)
 
void setChannelChangedCallback (boost::function< void()> channelChangedFn)
 
template<typename Class >
void setChannelChangedCallback (void(Class::*f)(), Class *obj)
 
Channel< T > getChannel ()
 Obtains the set or chosen channel. More...
 
virtual void update ()
 Tell the property to update the assigned channel. More...
 
void callback (ChannelRead< T > channel)
 
const std::string & getID () const
 Returns the channelID that was set by the user. More...
 
void setName (const std::string &name)
 Sets the name of the property. More...
 
const std::string & getName () const
 Returns the name of the property. More...
 
void setOptional ()
 For internal use only. More...
 
bool isOptional () const
 For internal use only. More...
 

Static Public Member Functions

template<typename Reflector >
static void channelProperty (Reflector &r, const std::string &name, ChannelProperty &channel, const std::string &comment, IAuthorityProvider *authorityProvider)
 Special property-method that should be called within the reflect method to specify a ChannelProperty. More...
 

Protected Attributes

std::string mName
 
std::string mChannelID
 
IAuthorityProvidermAuthorityProvider
 
bool mOptional
 

Detailed Description

template<typename T>
class mira::ChannelProperty< T >

The concrete typed ChannelProperty template class.

If you want to use channels that can be set using the property editor, you must use this ChannelProperty<T> class instead of Channel<T>. In your reflect method you need to call the channelProperty() method of this class which will install special getter and setter methods. These getter and setter methods will use the ChannelPropertyProxy as an interface to the PropertyEditor.

The set or chosen channel can be obtained using the getChannel() method which will subscribe the channel and return the corresponding Channel<T> object, if the channel exists.

Examples:
tutorials/Point2Visualization.C, and tutorials/Point3Visualization.C.

Constructor & Destructor Documentation

◆ ChannelProperty()

ChannelProperty ( )
inline

Member Function Documentation

◆ isValid()

virtual bool isValid ( ) const
inlinevirtual

Returns true, if an existing channel is set. Must be implemented in derived class.

Implements ChannelPropertyBase.

◆ getDataUpdateCount()

virtual uint32 getDataUpdateCount ( ) const
inlinevirtual

Returns the number of data updates the channel has received.

Implements ChannelPropertyBase.

◆ getAvailableChannels()

virtual std::list<std::pair<std::string, Typename> > getAvailableChannels ( )
inlinevirtual

Returns list of (channelID,typename) pairs containing the channels that match the desired type.

Must be implemented in derived class.

Implements ChannelPropertyBase.

◆ set()

virtual void set ( const std::string &  id,
IAuthorityProvider authorityProvider 
)
inlinevirtual

Sets the channelID and a necessary authority provider that is used to obtain the authority for subscribing the set channel.

Reimplemented from ChannelPropertyBase.

◆ setDataChangedCallback() [1/2]

void setDataChangedCallback ( boost::function< void(ChannelRead< T >)>  dataChangedFn)
inline

◆ setDataChangedCallback() [2/2]

void setDataChangedCallback ( void(Class::*)(ChannelRead< T >)  f,
Class obj 
)
inline

◆ setDataIntervalChangedCallback() [1/2]

void setDataIntervalChangedCallback ( boost::function< void(ChannelReadInterval< T >)>  dataChangedFn)
inline

◆ setDataIntervalChangedCallback() [2/2]

void setDataIntervalChangedCallback ( void(Class::*)(ChannelReadInterval< T >)  f,
Class obj 
)
inline

◆ setChannelChangedCallback() [1/2]

void setChannelChangedCallback ( boost::function< void()>  channelChangedFn)
inline

◆ setChannelChangedCallback() [2/2]

void setChannelChangedCallback ( void(Class::*)()  f,
Class obj 
)
inline

◆ getChannel()

Channel<T> getChannel ( )
inline

Obtains the set or chosen channel.

Will subscribe the channel (if not yet subscribed) and return the corresponding Channel<T> object, if the channel exists.

Exceptions
XRuntimeIf no channel is set or if the channel does not exist.

◆ update()

virtual void update ( )
inlinevirtual

Tell the property to update the assigned channel.

Exceptions
XRuntimeIf no channel is set or if the channel does not exist.

Implements ChannelPropertyBase.

◆ callback()

void callback ( ChannelRead< T >  channel)
inline

◆ channelProperty()

static void channelProperty ( Reflector &  r,
const std::string &  name,
ChannelProperty< T > &  channel,
const std::string &  comment,
IAuthorityProvider authorityProvider 
)
inlinestatic

Special property-method that should be called within the reflect method to specify a ChannelProperty.

Callbacks for channel data updates or changed channel selection can be set using the methods above.

◆ getID()

const std::string& getID ( ) const
inlineinherited

Returns the channelID that was set by the user.

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Sets the name of the property.

◆ getName()

const std::string& getName ( void  ) const
inlineinherited

Returns the name of the property.

◆ setOptional()

void setOptional ( )
inlineinherited

For internal use only.

◆ isOptional()

bool isOptional ( ) const
inlineinherited

For internal use only.

Member Data Documentation

◆ mName

std::string mName
protectedinherited

◆ mChannelID

std::string mChannelID
protectedinherited

◆ mAuthorityProvider

IAuthorityProvider* mAuthorityProvider
protectedinherited

◆ mOptional

bool mOptional
protectedinherited

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