50 #include <boost/lexical_cast.hpp> 61 , lock_policy(LOCK_FREE)
74 return *s_default_policy;
77 ConnPolicy ConnPolicy::buffer(
int size,
int lock_policy ,
bool init_connection ,
bool pull )
83 result.
init = init_connection;
88 ConnPolicy ConnPolicy::circularBuffer(
int size,
int lock_policy ,
bool init_connection ,
bool pull )
91 result.
type = CIRCULAR_BUFFER;
94 result.
init = init_connection;
99 ConnPolicy ConnPolicy::data(
int lock_policy ,
bool init_connection ,
bool pull )
104 result.
init = init_connection;
109 ConnPolicy::ConnPolicy()
110 : type(Default().type)
111 , size(Default().size)
112 , lock_policy(Default().lock_policy)
113 , init(Default().init)
114 , pull(Default().pull)
115 , buffer_policy(Default().buffer_policy)
116 , max_threads(Default().max_threads)
117 , mandatory(Default().mandatory)
118 , transport(Default().transport)
119 , data_size(Default().data_size)
138 , lock_policy(lock_policy)
156 default: type =
"(unknown type)";
break;
159 type +=
"[" + boost::lexical_cast<std::string>(cp.
size) +
"]";
167 default: lock_policy =
"(unknown lock policy)";
break;
172 switch(
int(cp.
pull)) {
179 os << lock_policy <<
" ";
static const int CIRCULAR_BUFFER
static ConnPolicy & Default()
Returns the process-wide default ConnPolicy that serves as a template for new ConnPolicy instances...
ConnPolicy()
Constructs a new ConnPolicy instance based on the current default settings as returned by ConnPolicy:...
int data_size
Suggest the payload size of the data sent over this channel.
int lock_policy
This is the locking policy on the connection.
int type
DATA, BUFFER or CIRCULAR_BUFFER.
A connection policy object describes how a given connection should behave.
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.
bool mandatory
Whether the connection described by this connection policy is mandatory, which means that write opera...
int max_threads
The maximum number of threads that will access the connection data or buffer object.
static const int LOCK_FREE
bool init
If true, one should initialize the connection's value with the last value written on the writer port...
std::ostream & operator<<(std::ostream &os, const BufferPolicy &bp)
BufferPolicy
The BufferPolicy controls how multiple connections to the same input or output port are handled in ca...
int transport
The prefered transport used.
int buffer_policy
The policy on how buffer elements will be installed for this connection, which influences the behavio...
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
std::string name_id
The name of this connection.
static const int UNBUFFERED