ICDPChannel Class
(ServerIO::ICDPChannel)ICDPChannel exposes methods from a channel that we expect to be on a CDP class based single type value converting channel from to CDP data source or sink like CDPSignal. More...
Header: | #include <IO/ServerIO/ICDPChannel.h> |
Inherits: | IChannel and CDP::StudioAPI::CDPNode |
Inherited By: |
Public Functions
virtual | ~ICDPChannel() |
virtual void | AddProperty(std::string name, std::string value) = 0 |
virtual void | Configure(XMLElementEx *pSignalXML) = 0 |
virtual void | Create(const char *name, CDPComponent *pParent) = 0 |
virtual void | Destroy() = 0 |
virtual std::string | GetProperty(const std::string &propertyName) = 0 |
virtual void | RegisterValidator(IChangeValidator *validator) = 0 |
virtual void | SetChannelMask(unsigned char mask) = 0 |
virtual void | SetChannelParameters(bool input, int moduleNo, int channelGroup, int channelNo) = 0 |
virtual void | SetNetworkConvert(bool networkConvert) = 0 |
virtual void | SetProperty(std::string name, std::string value) = 0 |
virtual void | UnregisterValidator(IChangeValidator *validator) = 0 |
Reimplemented Public Functions
virtual const char * | Name() const = 0 |
- 8 public functions inherited from ServerIO::IChannel
- 26 public functions inherited from CDP::StudioAPI::CDPNode
- 22 public functions inherited from CDP::StudioAPI::ICDPNode
Additional Inherited Members
- 2 protected functions inherited from ServerIO::IChannel
- 1 protected function inherited from CDP::StudioAPI::CDPNode
Detailed Description
ICDPChannel exposes methods from a channel that we expect to be on a CDP class based single type value converting channel from to CDP data source or sink like CDPSignal.
The purpose of this interface is to expose only what is needed to IOServer implementation to create and configure the channel via ICDPChannel interface and to convert to/from via IChannel interface.
All ICDPChannels should be registered in ChannelManager that must be created for each user/worker thread using the ICDPChannels.
See also IOServer, ServerIO, ServerIO::IChannel, and ServerIO::ChannelManager.
Member Function Documentation
[virtual]
ICDPChannel::~ICDPChannel()
Destroys the instance of ICDPChannel. The destructor is virtual.
[pure virtual]
void ICDPChannel::AddProperty(std::string name, std::string value)
Adds a new attribute to channel implementation that can be reset with SetProperty() method and that is automatically propagated to XML representation. The created property will be of type string.
name should hold a unique Name for the property.
value should hold an initial value of the property.
[pure virtual]
void ICDPChannel::Configure(XMLElementEx *pSignalXML)
Configures the Channel and implementation classes from XML.
pSignalXML is an element containing the configuration of the instance.
[pure virtual]
void ICDPChannel::Create(const char *name, CDPComponent *pParent)
Creates the signal and all properties for the internal CDP classes.
name should hold the Name for the class instance in CDP tree.
pParent is pointer to parent CDPComponent, indicating that Channels need to belong to IOServer.
[pure virtual]
void ICDPChannel::Destroy()
Destroys the channel.
[pure virtual]
std::string ICDPChannel::GetProperty(const std::string &propertyName)
Gets a property for the the channel.
propertyName should hold the Name of the property to Get.
Returns the value of the property.
[pure virtual]
const char *ICDPChannel::Name() const
Reimplemented from IChannel::Name().
Gets the short name of the channel.
Returns the const char pointer to the short name of instance.
[pure virtual]
void ICDPChannel::RegisterValidator(IChangeValidator *validator)
Registers a validator into a list of validators that is iterated on each value change in channel. Validators can block a value change when added.
validator holds the validator pointer to add/register into list.
The IChangeValidator-pointer could be a DeltaValidatorSendTrigger:
class MyPacket : public CDP::StudioAPI::CDPNode, public ServerIO::ISendOnPropertyChange ... pMyPacket* pPacket = new MyPacket(); ... if (triggerOnChange) { double triggerLevel = ...could be read from xml DeltaValidatorSendTrigger* pDeltaValidatorSendTrigger = new ServerIO::DeltaValidatorSendTrigger(pPacket, triggerLevel); pICDPChannel->RegisterValidator(pDeltaValidatorSendTrigger); }
See also IOServer::RegisterSendOnChange() and IOServer::RegisterSendOnChangeWakeCall().
[pure virtual]
void ICDPChannel::SetChannelMask(unsigned char mask)
Enables separately setting mask for channel. This mask has effect only on bool type channels.
mask to be used for bool type channel masking on SetData(), GetData() and with Sync() to/from external memory.
[pure virtual]
void ICDPChannel::SetChannelParameters(bool input, int moduleNo, int channelGroup, int channelNo)
Enables IOServer to set channel parameters separately from constructor.
input indicates the direction of the IOChannel (input or output to/from IOServer).
moduleNo may have arbitary use depending on IOServer type showing toplevel item in IOServer structure.
channelGroup may have arbitary use depending on IOServer type showing allocation inside moduleNo.
channelNo may have arbitary use depending on IOServer type showing allocation inside channelGroup (on bool data type channels this is used as number of mask bit by default mask=1<<channelNo).
[pure virtual]
void ICDPChannel::SetNetworkConvert(bool networkConvert)
Specifies if networkconvert will be done or not in SyncOut()/SyncIn().
If networkConvert is true
, FromBigendian()/ToBigendian() will be called on data in SyncOut()/SyncIn(), otherwise just memcpy
will be performed.
[pure virtual]
void ICDPChannel::SetProperty(std::string name, std::string value)
Sets a property for the the channel.
name should hold the Name of the property to Set.
value should hold the Value to be set on the property.
[pure virtual]
void ICDPChannel::UnregisterValidator(IChangeValidator *validator)
Removes validator from list and revoke ownership.
validator holds the validator pointer to remove.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.