Flexiport 2.0.0
Classes | Functions

flexiport Namespace Reference

Classes

class  PortException
 Exception thrown by the Port class and its derivatives. More...
class  LogFile
class  LogReaderPort
 Simulated port using a log file. More...
class  LogWriterPort
 Logging implementation of the Port class. More...
class  Port
 Base Port class. More...
class  SerialPort
 Serial implementation of the Port class. More...
class  TCPPort
 TCP implementation of the Port class. More...
class  Timeout
 An object used to represent timeouts. More...
class  UDPPort
 UDP implementation of the Port class. More...

Functions

FLEXIPORT_EXPORT PortCreatePort (std::map< std::string, std::string > options)
 Function to create a Port object of the necessary port type.
FLEXIPORT_EXPORT PortCreatePort (std::string options)
 Overloaded factory function.

Function Documentation

FLEXIPORT_EXPORT Port* flexiport::CreatePort ( std::map< std::string, std::string >  options)

Function to create a Port object of the necessary port type.

This factory function is the only way to create a Port object matching the type of port you need. Options are passed in as key/value pairs in the options argument. A minimum of one option is necessary, the "type" option. This specifies the type of port to be created. An object of the correct class (SerialPort, TCPPort or LogReaderPort, for example) will be created based on the value of this option. All other options, including both universal options and type-specific options, will be passed on to the created object.

See Options for a list of options accepted by all port types. See each port type's description for a list of options accepted by that port type.

Parameters:
optionsA map of port creation options as key/value pairs.
Returns:
A pointer to a Port object.
FLEXIPORT_EXPORT Port* flexiport::CreatePort ( std::string  options)

Overloaded factory function.

Accepts options as a string.

This overload accepts the options as a string. For example: "type=serial device=/dev/ttyS0 baud=4800 readwrite" Options may be separated by any of: spaces, tabs, new lines or commas. Do not put whitespace around an equals sign.

Parameters:
optionsA string containing the port creation options.
Returns:
A pointer to a Port object.
 All Classes Namespaces Files Functions Variables Defines