The concrete typed ChannelProperty template class.
More...
#include <visualization/ChannelProperty.h>
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.
◆ ChannelProperty()
◆ 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 |
◆ 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()
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]
◆ setDataIntervalChangedCallback() [1/2]
void setDataIntervalChangedCallback |
( |
boost::function< void(ChannelReadInterval< T >)> |
dataChangedFn | ) |
|
|
inline |
◆ setDataIntervalChangedCallback() [2/2]
◆ setChannelChangedCallback() [1/2]
void setChannelChangedCallback |
( |
boost::function< void()> |
channelChangedFn | ) |
|
|
inline |
◆ setChannelChangedCallback() [2/2]
void setChannelChangedCallback |
( |
void(Class::*)() |
f, |
|
|
Class * |
obj |
|
) |
| |
|
inline |
◆ getChannel()
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
-
XRuntime | If no channel is set or if the channel does not exist. |
◆ update()
Tell the property to update the assigned channel.
- Exceptions
-
XRuntime | If no channel is set or if the channel does not exist. |
Implements ChannelPropertyBase.
◆ callback()
◆ 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()
◆ isOptional()
bool isOptional |
( |
| ) |
const |
|
inlineinherited |
◆ mName
◆ mChannelID
◆ mAuthorityProvider
◆ mOptional
The documentation for this class was generated from the following file: