Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
RTT::ConnPolicy Class Reference

#include <ConnPolicy.hpp>

Inheritance diagram for RTT::ConnPolicy:
Inheritance graph
[legend]

Classes

struct  ConnPolicyDefault
 

Public Member Functions

 ConnPolicy ()
 
 ConnPolicy (int type)
 
 ConnPolicy (int type, int lock_policy)
 

Static Public Member Functions

static ConnPolicy buffer (int size, int lock_policy=LOCK_FREE, bool init_connection=false, bool pull=false)
 
static ConnPolicy circularBuffer (int size, int lock_policy=LOCK_FREE, bool init_connection=false, bool pull=false)
 
static ConnPolicy data (int lock_policy=LOCK_FREE, bool init_connection=true, bool pull=false)
 
static ConnPolicyDefault ()
 

Public Attributes

int buffer_policy
 
int data_size
 
bool init
 
int lock_policy
 
bool mandatory
 
int max_threads
 
std::string name_id
 
bool pull
 
int size
 
int transport
 
int type
 

Static Public Attributes

static const int BUFFER = 1
 
static const int CIRCULAR_BUFFER = 2
 
static const int DATA = 0
 
static const int LOCK_FREE = 2
 
static const int LOCKED = 1
 
static const bool PULL = true
 
static const bool PUSH = false
 
static const int UNBUFFERED = -1
 
static const int UNSYNC = 0
 

Private Member Functions

 ConnPolicy (const ConnPolicyDefault &)
 

Detailed Description

A connection policy object describes how a given connection should behave. Various parameters are available:

Definition at line 107 of file ConnPolicy.hpp.

Constructor & Destructor Documentation

ConnPolicy::ConnPolicy ( )

Constructs a new ConnPolicy instance based on the current default settings as returned by ConnPolicy::Default().

Definition at line 109 of file ConnPolicy.cpp.

ConnPolicy::ConnPolicy ( int  type)
explicit

Constructs a new ConnPolicy instance based on the current default settings as returned by ConnPolicy::Default(), but overrides the type. You should not use this contructor anymore and prefer the static methods ConnPolicy::data(), ConnPolicy::buffer(), etc. instead.

Parameters
type
Deprecated:

Definition at line 122 of file ConnPolicy.cpp.

ConnPolicy::ConnPolicy ( int  type,
int  lock_policy 
)
explicit

Constructs a new ConnPolicy instance based on the current default settings as returned by ConnPolicy::Default(), but overrides the type and lock_policy. You should not use this contructor anymore and prefer the static methods ConnPolicy::data(), ConnPolicy::buffer(), etc. instead.

Parameters
type
lock_policy
Deprecated:

Definition at line 135 of file ConnPolicy.cpp.

ConnPolicy::ConnPolicy ( const ConnPolicyDefault )
private

Definition at line 58 of file ConnPolicy.cpp.

Member Function Documentation

ConnPolicy ConnPolicy::buffer ( int  size,
int  lock_policy = LOCK_FREE,
bool  init_connection = false,
bool  pull = false 
)
static

Create a policy for a (lock-free) fifo buffer connection of a given size.

Parameters
sizeThe size of the buffer in this connection
lock_policyThe locking policy
init_connectionIf an initial sample should be pushed into the buffer upon creation.
pullIn inter-process cases, should the consumer pull itself ?
Returns
the specified policy.

Definition at line 77 of file ConnPolicy.cpp.

ConnPolicy ConnPolicy::circularBuffer ( int  size,
int  lock_policy = LOCK_FREE,
bool  init_connection = false,
bool  pull = false 
)
static

Create a policy for a (lock-free) circular fifo buffer connection of a given size.

Parameters
sizeThe size of the buffer in this connection
lock_policyThe locking policy
init_connectionIf an initial sample should be pushed into the buffer upon creation.
pullIn inter-process cases, should the consumer pull itself ?
Returns
the specified policy.

Definition at line 88 of file ConnPolicy.cpp.

ConnPolicy ConnPolicy::data ( int  lock_policy = LOCK_FREE,
bool  init_connection = true,
bool  pull = false 
)
static

Create a policy for a (lock-free) shared data connection of a given size.

Parameters
lock_policyThe locking policy
init_connectionIf the data object should be initialised with the last value of the OutputPort upon creation.
pullIn inter-process cases, should the consumer pull data itself ?
Returns
the specified policy.

Definition at line 99 of file ConnPolicy.cpp.

ConnPolicy & ConnPolicy::Default ( )
static

Returns the process-wide default ConnPolicy that serves as a template for new ConnPolicy instances.

This method returns a non-const reference and you can change the defaults. This is not thread-safe and should only be done very early in the deployment phase, before the first component is loaded and before connecting ports.

Definition at line 71 of file ConnPolicy.cpp.

Member Data Documentation

const int RTT::ConnPolicy::BUFFER = 1
static

Definition at line 112 of file ConnPolicy.hpp.

int RTT::ConnPolicy::buffer_policy

The policy on how buffer elements will be installed for this connection, which influences the behavior of reads and writes if the port has muliple connections. See BufferPolicy enum for possible options.

Definition at line 216 of file ConnPolicy.hpp.

const int RTT::ConnPolicy::CIRCULAR_BUFFER = 2
static

Definition at line 113 of file ConnPolicy.hpp.

const int RTT::ConnPolicy::DATA = 0
static

Definition at line 111 of file ConnPolicy.hpp.

int RTT::ConnPolicy::data_size
mutable

Suggest the payload size of the data sent over this channel. Connections can use this value to optimize transmission or prepare the communication channel for real-time communication. This value might be overruled by the transport protocol if it can make a better guess. The interpretation of data_size is transport specific. It may be bytes, it may be something else. Leave this value set to zero, unless the transport documents otherwise.

Definition at line 248 of file ConnPolicy.hpp.

bool RTT::ConnPolicy::init

If true, one should initialize the connection's value with the last value written on the writer port. This is only possible if the writer port has the keepsLastWrittenValue() flag set (i.e. if it remembers what was the last written value).

Definition at line 203 of file ConnPolicy.hpp.

const int RTT::ConnPolicy::LOCK_FREE = 2
static

Definition at line 117 of file ConnPolicy.hpp.

int RTT::ConnPolicy::lock_policy

This is the locking policy on the connection

Definition at line 196 of file ConnPolicy.hpp.

const int RTT::ConnPolicy::LOCKED = 1
static

Definition at line 116 of file ConnPolicy.hpp.

bool RTT::ConnPolicy::mandatory

Whether the connection described by this connection policy is mandatory, which means that write operations will fail if the connection could not be served, e.g. due to a full input buffer or because of a broken remote connection. By default, all connections are mandatory.

Definition at line 232 of file ConnPolicy.hpp.

int RTT::ConnPolicy::max_threads

The maximum number of threads that will access the connection data or buffer object. This only needs to be specified for lock-free data structures. If 0, the number of threads will be determined by a simple heuristic depending on the read and write policies of the connection.

Definition at line 224 of file ConnPolicy.hpp.

std::string RTT::ConnPolicy::name_id
mutable

The name of this connection. May be used by transports to define a 'topic' or lookup name to connect two data streams. If you leave this empty (recommended), the protocol will choose an appropriate name itself. Only specify a name to work around name clashes or if the transport protocol documents to do so.

Definition at line 256 of file ConnPolicy.hpp.

const bool RTT::ConnPolicy::PULL = true
static

Definition at line 120 of file ConnPolicy.hpp.

bool RTT::ConnPolicy::pull

If true, then the sink will have to pull data. Otherwise, it is pushed from the source. In both cases, the reader side is notified that new data is available by base::ChannelElementBase::signal()

Definition at line 209 of file ConnPolicy.hpp.

const bool RTT::ConnPolicy::PUSH = false
static

Definition at line 119 of file ConnPolicy.hpp.

int RTT::ConnPolicy::size

If the connection is a buffered connection, the size of the buffer

Definition at line 193 of file ConnPolicy.hpp.

int RTT::ConnPolicy::transport

The prefered transport used. 0 is local (in process), a higher number is used for inter-process or networked communication transports.

Definition at line 238 of file ConnPolicy.hpp.

int RTT::ConnPolicy::type

DATA, BUFFER or CIRCULAR_BUFFER

Definition at line 190 of file ConnPolicy.hpp.

const int RTT::ConnPolicy::UNBUFFERED = -1
static

Definition at line 110 of file ConnPolicy.hpp.

const int RTT::ConnPolicy::UNSYNC = 0
static

Definition at line 115 of file ConnPolicy.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:41