54 ConnPolicy ConnPolicy::buffer(
int size,
int lock_policy ,
bool init_connection ,
bool pull )
57 result.
init = init_connection;
63 ConnPolicy ConnPolicy::circularBuffer(
int size,
int lock_policy ,
bool init_connection ,
bool pull )
65 ConnPolicy result(CIRCULAR_BUFFER, lock_policy);
66 result.
init = init_connection;
72 ConnPolicy ConnPolicy::data(
int lock_policy ,
bool init_connection ,
bool pull )
75 result.
init = init_connection;
80 ConnPolicy::ConnPolicy(
int type ,
int lock_policy )
81 : type(type), init(false), lock_policy(lock_policy), pull(false), size(0), transport(0), data_size(0) {}
91 if ( bag.
getType() !=
"ConnPolicy")
93 log(
Debug) <<
"Composing ConnPolicy..." <<endlog();
97 else if ( bag.
find(
"type") ){
98 log(
Error) <<
"ConnPolicy: wrong property type of 'type'."<<endlog();
104 else if ( bag.
find(
"lock_policy") ){
105 log(
Error) <<
"ConnPolicy: wrong property type of 'lock_policy'."<<endlog();
111 else if ( bag.
find(
"size") ){
112 log(
Error) <<
"ConnPolicy: wrong property type of 'size'."<<endlog();
118 else if ( bag.
find(
"data_size") ){
119 log(
Error) <<
"ConnPolicy: wrong property type of 'data_size'."<<endlog();
125 else if ( bag.
find(
"transport") ){
126 log(
Error) <<
"ConnPolicy: wrong property type of 'transport'."<<endlog();
133 else if ( bag.
find(
"init") ){
134 log(
Error) <<
"ConnPolicy: wrong property type of 'init'."<<endlog();
140 else if ( bag.
find(
"pull") ){
141 log(
Error) <<
"ConnPolicy: wrong property type of 'pull'."<<endlog();
148 else if ( bag.
find(
"name_id") ){
149 log(
Error) <<
"ConnPolicy: wrong property type of 'name_id'."<<endlog();
160 log(
Debug) <<
"Decomposing ConnPolicy..." <<endlog();
161 assert( targetbag.
empty() );
162 targetbag.
setType(
"ConnPolicy");
DataSourceType get() const
Get a copy of the value of the property.
bool ready() const
Inspect if this Property is correctly initialised and ready for usage.
const std::string & getType() const
int data_size
Suggest the payload size of the data sent over this channel.
void setType(const std::string &newtype)
int lock_policy
This is the locking policy on the connection.
int type
DATA, BUFFER or CIRCULAR_BUFFER.
A container for holding references to properties.
A connection policy object describes how a given connection should behave.
bool ownProperty(base::PropertyBase *p)
Set a property to be owned by this bag.
int size
If the connection is a buffered connection, the size of the buffer.
bool pull
If true, then the sink will have to pull data.
base::PropertyBase * find(const std::string &name) const
Find the base::PropertyBase with name name.
A property represents a named value of any type with a description.
bool empty() const
Return true if no properties are present in this bag.
bool init
If true, one should initialize the connection's value with the last value written on the writer port...
base::PropertyBase * getProperty(const std::string &name) const
Get a Property with name name.
int transport
The prefered transport used.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
std::string name_id
The name of this connection.