OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
Attributes Class Reference

Public Member Functions

 Attributes ()
 ~Attributes ()
 Attributes (const Attributes &other)
Attributesoperator= (const Attributes &other)
void networkInterface (const std::string &ifName)
std::string getString (const std::string &name)
void set (const std::string &name, const std::string &value)
int64_t getInt (const std::string &name)
void set (const std::string &name, uint64_t value)

Friends

class Stack

Detailed Description

The default values for attributes may be overridden by setting the environment variable ZF_Attributes. For example:

ZF_Attributes="interface=enp4s0f0;log_level=3;reactor_spin_count=1"

Definition at line 40 of file TcpDirectAttr.h.

Constructor & Destructor Documentation

◆ Attributes() [1/2]

Allocate an attribute object.

Exceptions
Thestd::bad_alloc is thrown if the memory could not be allocated.
Thestd::runtime_error if the ZF_Attributes environment variable is malformed.

◆ ~Attributes()

~Attributes ( )

◆ Attributes() [2/2]

Attributes ( const Attributes & other)

Member Function Documentation

◆ getInt()

int64_t getInt ( const std::string & name)

Gets the attribute value.

Parameters
nameThe name of the attribute.
Exceptions
Thestd::logic_error is thrown if the name is not a valid attribute name or if the name does not have an integer type.

◆ getString()

std::string getString ( const std::string & name)

Gets the attribute value.

Parameters
nameThe name of the attribute.
Exceptions
Thestd::logic_error is thrown if the name is not a valid attribute name or if the name does not have a string type.

◆ networkInterface()

void networkInterface ( const std::string & ifName)
inline

Sets the network interface name.

Definition at line 57 of file TcpDirectAttr.h.

◆ operator=()

Attributes & operator= ( const Attributes & other)

◆ set() [1/2]

void set ( const std::string & name,
const std::string & value )

Sets an attribute to a string value.

Parameters
nameThe name of the attribute.
valueThe new value for the attribute.
Exceptions
Thestd::logic_error is thrown if the name is not a valid attribute name or if the attribute is not a string attribute.

◆ set() [2/2]

void set ( const std::string & name,
uint64_t value )

Sets an attribute to an integer value.

Parameters
nameThe name of the attribute.
valueThe new value for the attribute.
Exceptions
Thestd::logic_error is thrown if the name is not a valid attribute name.
Thestd::domain_error is thrown if the value is not within the range of values this attribute can take.

◆ Stack

friend class Stack
friend

Definition at line 109 of file TcpDirectAttr.h.