YARP
Yet Another Robot Platform
yarp::os Namespace Reference

An interface to the operating system, including Port based communication. More...

Detailed Description

An interface to the operating system, including Port based communication.

Namespaces

 idl
 
 impl
 The components from which ports and connections are built.
 
 Time
 
 Vocab
 

Classes

class  AbstractCarrier
 A starter class for implementing simple carriers. More...
 
class  AbstractContactable
 A default implementation of an abstract port. More...
 
class  AbstractLockGuard
 This class is a mutex wrapper that provides a convenient RAII-style mechanism for owning a mutex for the duration of a scoped block. More...
 
class  BayerCarrier
 Decode bayer images and serve them as regular rgb. More...
 
class  BinPortable
 Class for writing and reading simple binary structures. More...
 
class  Bottle
 A simple collection of objects that can be described and transmitted in a portable way. More...
 
class  BufferedPort
 A mini-server for performing network communication in the background. More...
 
class  Bytes
 A simple abstraction for a block of bytes. More...
 
class  Carrier
 A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP. More...
 
class  Carriers
 Collection of carriers, a singleton. More...
 
class  Clock
 
class  Connection
 A controller for an individual connection. More...
 
class  ConnectionReader
 An interface for reading from a network connection. More...
 
class  ConnectionState
 The basic state of a connection - route, streams in use, etc. More...
 
class  ConnectionWriter
 An interface for writing to a network connection. More...
 
class  ConnectResult
 
class  Contact
 Represents how to reach a part of a YARP network. More...
 
class  Contactable
 An abstract port. More...
 
class  Contactables
 The yarp::os::Contactables class. More...
 
class  ContactStyle
 Preferences for how to communicate with a contact. More...
 
class  DummyConnector
 A dummy connection to test yarp::os::Portable implementations. More...
 
class  ElectionOf
 Pick one of a set of peers to be "active". More...
 
class  Event
 A class for thread synchronization and mutual exclusion. More...
 
class  Face
 The initial point-of-contact with a port. More...
 
class  H264Carrier
 A carrier for receiving frames compressed in h264 over rtp. More...
 
class  H264Decoder
 
class  H264Stream
 
class  IConfig
 An object that can be configured. More...
 
class  InputProtocol
 The input side of an active connection between two ports. More...
 
class  InputStream
 Simple specification of the minimum functions needed from input streams. More...
 
class  LocalReader
 Under development. More...
 
class  Log
 
class  LogStream
 
class  ManagedBytes
 An abstraction for a block of bytes, with optional responsibility for allocating/destroying that block. More...
 
class  MessageStack
 Maintain a stack of messages to send asynchronously. More...
 
class  MjpegCarrier
 A carrier for sending/receiving images via mjpeg over http. More...
 
class  MjpegStream
 
class  ModifyingCarrier
 A starter class for implementing simple modifying carriers. More...
 
class  MonitorObject
 
class  MpiBcastCarrier
 Carrier for port communicating via MPI broadcast. More...
 
class  MpiBcastStream
 Implements communication via MPI broadcast. More...
 
class  MpiCarrier
 Abstract base carrier for managing port communication via MPI. More...
 
class  MpiComm
 Wrapper for MPI_Comm communicator. More...
 
class  MpiControlThread
 
class  MpiP2PCarrier
 Carrier for port communicating via MPI point-to-point send/receive. More...
 
class  MpiP2PStream
 Implements communication via MPI point-to-point send/receive. More...
 
class  MpiStream
 Abstract base class for port communication via MPI. More...
 
class  MultiNameSpace
 
class  Mutex
 Basic wrapper for mutual exclusion. More...
 
class  Name
 Simple abstraction for a YARP port name. More...
 
class  NameSpace
 An abstract name space for ports. More...
 
class  NameStore
 Abstract interface for a database of port names. More...
 
class  NestedContact
 A placeholder for rich contact information. More...
 
class  NetType
 Various utilities related to types and formats. More...
 
class  Network
 Utilities for manipulating the YARP network, including initialization and shutdown. More...
 
class  NetworkBase
 Utilities for manipulating the YARP network, excluding initialization and shutdown. More...
 
class  NetworkClock
 
class  Node
 The Node class. More...
 
class  Nodes
 The Nodes class. More...
 
class  NullConnection
 
class  NullConnectionReader
 Dummy ConnectionReader that has no data. More...
 
class  NullConnectionWriter
 A dummy ConnectionWriter that consumes data without effect. More...
 
class  NullStream
 A "null" stream, always invalid. More...
 
class  OutputProtocol
 The output side of an active connection between two ports. More...
 
class  OutputStream
 Simple specification of the minimum functions needed from output streams. More...
 
class  PeerRecord
 
class  PeriodicThread
 
class  Ping
 Measure performance of a YARP port. More...
 
class  Port
 A mini-server for network communication. More...
 
class  Portable
 This is a base class for objects that can be both read from and be written to the YARP network. More...
 
class  PortablePair
 Group a pair of objects to be sent and received together. More...
 
class  PortablePairBase
 
class  PortInfo
 Information about a port connection or event. More...
 
class  PortMonitor
 Allow to monitor and modify port data from Lua script Under development. More...
 
class  PortMonitorGroup
 Manager for arbitration-aware inputs to a given port. More...
 
class  PortReader
 Interface implemented by all objects that can read themselves from the network, such as Bottle objects. More...
 
class  PortReaderBuffer
 Buffer incoming data to a port. More...
 
class  PortReaderBufferBase
 
class  PortReaderBufferBaseCreator
 
class  PortReaderCreator
 A creator for readers. More...
 
class  PortReport
 A base class for objects that want information about port status changes. More...
 
class  PortWriter
 Interface implemented by all objects that can write themselves to the network, such as Bottle objects. More...
 
class  PortWriterBuffer
 Buffer outgoing data to a port. More...
 
class  PortWriterBufferAdaptor
 
class  PriorityCarrier
 Allow priority-based message selection. More...
 
class  PriorityDebugThread
 
class  PriorityGroup
 Manager for priority-aware inputs to a given port. More...
 
class  Property
 A class for storing options and configuration information. More...
 
class  Publisher
 A port specialized for publishing data of a constant type on a topic. More...
 
class  QosStyle
 Preferences for the port's Quality of Service. More...
 
class  Random
 A collection of basic random number generation algorithms. More...
 
class  RateResult
 
class  RateThread
 An abstraction for a periodic thread. More...
 
class  RateThreadWrapper
 This class takes a Runnable instance and wraps a thread around it. More...
 
class  RecursiveMutex
 RecursiveMutex offers exclusive, recursive ownership semantics: More...
 
class  ResourceFinder
 Helper class for finding config files and other external resources. More...
 
class  ResourceFinderOptions
 These options are loosely based on http://wiki.icub.org/wiki/YARP_ResourceFinder. More...
 
class  RFModule
 A base-class for standard Yarp modules that supports ResourceFinder. More...
 
class  RosNameSpace
 
class  RosSrvCarrier
 
class  Route
 Information about a connection between two ports. More...
 
class  RpcClient
 A port that is specialized as an RPC client. More...
 
class  RpcServer
 A port that is specialized as an RPC server. More...
 
class  Run
 yarprun provides the APIs to a client-server environment that is able to run, kill and monitor applications commands on a remote machin in Windows and Linux. More...
 
class  Runnable
 A class that can be managed by another thread. More...
 
class  Searchable
 A base class for nested structures that can be searched. More...
 
class  Semaphore
 A class for thread synchronization and mutual exclusion. More...
 
class  SharedLibrary
 Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it. More...
 
class  SharedLibraryClass
 Container for an object created using a factory provided by a shared library. More...
 
struct  SharedLibraryClassApi
 Collection of hooks for creating/destroying a plugin. More...
 
class  SharedLibraryClassFactory
 A type-safe wrapper for SharedLibraryFactory, committing to creation/destruction of instances of a particular super-class. More...
 
class  SharedLibraryFactory
 A wrapper for a named factory method in a named shared library. More...
 
class  ShiftStream
 A container for a stream, allowing the stream implementation to be replaced when needed. More...
 
class  SizedWriter
 Minimal requirements for an efficient Writer. More...
 
class  Stamp
 An abstraction for a time stamp and/or sequence number. More...
 
class  Stamped
 A base class for objects with time stamps and/or sequence numbers. More...
 
class  Stat
 
class  StringInputStream
 An InputStream that reads from a string. More...
 
class  StringOutputStream
 An OutputStream that produces a string. More...
 
class  Subscriber
 A port specialized for reading data of a constant type published on a topic. More...
 
class  SystemClock
 
class  SystemInfo
 A class to get the system (platform) status such as available memory, storage, CPU load and etc. More...
 
class  SystemInfoSerializer
 A helper class to pass the SystemInfo object around the YARP network. More...
 
class  SystemRateThread
 
class  TcpRosCarrier
 
class  TcpRosStream
 
class  Terminator
 Send a message to a process that has a corresponding socket port created using the Terminee class to ask to start a graceful quit procedure. More...
 
class  Terminee
 A class that can be polled to see whether the process has been asked to quit gracefully. More...
 
class  Things
 Base class for generic things. More...
 
class  Thread
 An abstraction for a thread of execution. More...
 
class  Timer
 
struct  TimerSettings
 
class  TwoWayStream
 A stream which can be asked to perform bidirectional communication. More...
 
class  Type
 
class  TypedReader
 A base class for sources of typed data. More...
 
class  TypedReaderCallback
 A callback for typed data from a port. More...
 
class  TypedReaderThread
 
class  UnbufferedContactable
 An abstract unbuffered port. More...
 
class  Value
 A single value (typically within a Bottle). More...
 
class  Wire
 Base class for IDL client/server. More...
 
class  WireLink
 IDL-friendly object state, used in YARP to set up a port association. More...
 
class  XmlRpcCarrier
 This carrier enables XML/RPC message transmission. More...
 
class  XmlRpcStream
 
class  YarpDummyNameSpace
 
class  YarpNameSpace
 
class  YarpPlugin
 Type-safe access to a plugin. More...
 
class  YarpPluginSelector
 Pick out a set of relevant plugins. More...
 
class  YarpPluginSettings
 Collect hints for finding a particular plugin. More...
 
struct  YarpTimerEvent
 

Typedefs

typedef std::string ConstString
 
typedef AbstractLockGuard< MutexLockGuard
 
typedef AbstractLockGuard< RecursiveMutexRecursiveLockGuard
 
typedef yarp::conf::float32_t NetFloat32
 Definition of the NetFloat32 type. More...
 
typedef yarp::conf::float64_t NetFloat64
 Definition of the NetFloat64 type. More...
 
typedef std::int16_t NetInt16
 Definition of the NetInt16 type. More...
 
typedef std::int32_t NetInt32
 Definition of the NetInt32 type. More...
 
typedef std::int64_t NetInt64
 Definition of the NetInt64 type. More...
 
typedef std::int8_t NetInt8
 Definition of the NetInt8 type. More...
 
typedef std::uint16_t NetUint16
 Definition of the NetUint16 type. More...
 
typedef std::uint32_t NetUint32
 Definition of the NetUint32 type. More...
 
typedef std::uint64_t NetUint64
 Definition of the NetInt64 type. More...
 
typedef std::uint8_t NetUint8
 Definition of the NetUint8 type. More...
 
typedef yarp::run::Run Run
 

Enumerations

enum  ShouldUseSystemClock {
  ShouldUseSystemClock::No = 0,
  ShouldUseSystemClock::Yes = 1
}
 
enum  yarpClockType {
  YARP_CLOCK_UNINITIALIZED =-1,
  YARP_CLOCK_DEFAULT,
  YARP_CLOCK_SYSTEM,
  YARP_CLOCK_NETWORK,
  YARP_CLOCK_CUSTOM
}
 

Functions

const char * getenv (const char *var)
 Portable wrapper for the getenv() function. More...
 
int getpid ()
 Portable wrapper for the getppid() function. More...
 
void gethostname (char *hostname, size_t size)
 Portable wrapper for the gethostname() function. More...
 
int mkdir (const char *p)
 Portable wrapper for the mkdir() function. More...
 
int mkdir_p (const char *p, int ignoreLevels=0)
 Create a directory and all parent directories needed. More...
 
int rmdir (const char *p)
 Portable wrapper for the rmdir() function. More...
 
int rename (const char *oldname, const char *newname)
 Portable wrapper for the rename() function. More...
 
int stat (const char *path)
 Portable wrapper for the stat() function. More...
 
char * getcwd (char *buf, size_t size)
 Portable wrapper for the getcwd() function. More...
 
void setEnergySavingModeState (bool enabled)
 Toggle the OS energy saving feature. More...
 
void setprogname (const char *progname)
 Portable wrapper for the setprogname() function. More...
 
void getprogname (char *progname, size_t size)
 Portable wrapper for the getprogname() function. More...
 
int fork (void)
 Portable wrapper for the fork() function. More...
 
constexpr yarp::conf::vocab32_t createVocab (char a, char b=0, char c=0, char d=0)
 

Typedef Documentation

◆ ConstString

typedef std::string yarp::os::ConstString

Definition at line 18 of file ConstString.h.

◆ LockGuard

Definition at line 21 of file LockGuard.h.

◆ NetFloat32

Definition of the NetFloat32 type.

Definition at line 44 of file NetFloat32.h.

◆ NetFloat64

Definition of the NetFloat64 type.

Definition at line 44 of file NetFloat64.h.

◆ NetInt16

typedef std::int16_t yarp::os::NetInt16

Definition of the NetInt16 type.

Definition at line 32 of file NetInt16.h.

◆ NetInt32

typedef std::int32_t yarp::os::NetInt32

Definition of the NetInt32 type.

Examples:
port_power/TargetVer1.h, and port_power/TargetVer1b.h.

Definition at line 32 of file NetInt32.h.

◆ NetInt64

typedef std::int64_t yarp::os::NetInt64

Definition of the NetInt64 type.

Definition at line 32 of file NetInt64.h.

◆ NetInt8

typedef std::int8_t yarp::os::NetInt8

Definition of the NetInt8 type.

Definition at line 18 of file NetInt8.h.

◆ NetUint16

typedef std::uint16_t yarp::os::NetUint16

Definition of the NetUint16 type.

Definition at line 32 of file NetUint16.h.

◆ NetUint32

typedef std::uint32_t yarp::os::NetUint32

Definition of the NetUint32 type.

Definition at line 32 of file NetUint32.h.

◆ NetUint64

typedef std::uint64_t yarp::os::NetUint64

Definition of the NetInt64 type.

Definition at line 32 of file NetUint64.h.

◆ NetUint8

typedef std::uint8_t yarp::os::NetUint8

Definition of the NetUint8 type.

Definition at line 18 of file NetUint8.h.

◆ RecursiveLockGuard

◆ Run

Definition at line 22 of file Run.h.

Enumeration Type Documentation

◆ ShouldUseSystemClock

Enumerator
No 
Yes 

Definition at line 22 of file Time.h.

◆ yarpClockType

Enumerator
YARP_CLOCK_UNINITIALIZED 
YARP_CLOCK_DEFAULT 
YARP_CLOCK_SYSTEM 
YARP_CLOCK_NETWORK 
YARP_CLOCK_CUSTOM 

Definition at line 24 of file Time.h.

Function Documentation

◆ createVocab()

constexpr yarp::conf::vocab32_t yarp::os::createVocab ( char  a,
char  b = 0,
char  c = 0,
char  d = 0 
)

Definition at line 43 of file Vocab.h.

◆ fork()

int yarp::os::fork ( void  )

Portable wrapper for the fork() function.

Create a child process.

Returns
On success, the PID of the child process is returned in the parent, and 0 is returned in the child. On failure, -1 is returned in the parent, no child process is created, and errno is set appropriately
Deprecated:
since YARP 3.0.0

Definition at line 154 of file Os.cpp.

◆ getcwd()

char * yarp::os::getcwd ( char *  buf,
size_t  size 
)

Portable wrapper for the getcwd() function.

Get current working directory. The getcwd() function copies an absolute pathname of the current working directory to the array pointed to by buf, which is of length size.

Parameters
[out]bufThe buffer where the path is copied
sizeThe size of the buffer
Returns
a pointer to buf or NULL on failure

Definition at line 107 of file Os.cpp.

◆ getenv()

const char * yarp::os::getenv ( const char *  var)

Portable wrapper for the getenv() function.

Get an environment variable.

Parameters
[in]varstring that contains the environment variable name
Returns
the value corresponding to the envarionment variable v

Definition at line 34 of file Os.cpp.

◆ gethostname()

void yarp::os::gethostname ( char *  hostname,
size_t  size 
)

Portable wrapper for the gethostname() function.

Returns the null-terminated hostname in the character array hostname, which has a length of size bytes.

Parameters
[out]hostnamethe system hostname
sizeThe size of the hostname array

Definition at line 99 of file Os.cpp.

◆ getpid()

int yarp::os::getpid ( )

Portable wrapper for the getppid() function.

Get process identification.

Returns
the process id (pid)

Definition at line 93 of file Os.cpp.

◆ getprogname()

void yarp::os::getprogname ( char *  progname,
size_t  size 
)

Portable wrapper for the getprogname() function.

Get the program name.

Parameters
[out]prognamethe program name
sizeThe size of the progname array
Deprecated:
Since YARP 3.0.0. Use yarp::os::SystemInfo::getProcessInfo().name.

Definition at line 138 of file Os.cpp.

◆ mkdir()

int yarp::os::mkdir ( const char *  p)

Portable wrapper for the mkdir() function.

Create a directory.

Parameters
[in]pname of the new directory
Returns
0 on success
See also
mkdir_p

Definition at line 39 of file Os.cpp.

◆ mkdir_p()

int yarp::os::mkdir_p ( const char *  p,
int  ignoreLevels = 0 
)

Create a directory and all parent directories needed.

Parameters
[in]pdesired path
ignoreLevelscomponents of name to ignore. Set to 1 if last element of path is a filename, for example
Returns
0 on success
See also
mkdir

Definition at line 44 of file Os.cpp.

◆ rename()

int yarp::os::rename ( const char *  oldname,
const char *  newname 
)

Portable wrapper for the rename() function.

Changes the name of the file or directory specified by oldname to newname.

Parameters
[in]oldnameold name of the file/directory
[in]newnamenew name of the file/directory
Returns
0 on success

Definition at line 82 of file Os.cpp.

◆ rmdir()

int yarp::os::rmdir ( const char *  p)

Portable wrapper for the rmdir() function.

Remove an empty directory.

Parameters
[in]pname of the directory
Returns
0 on success

Definition at line 77 of file Os.cpp.

◆ setEnergySavingModeState()

void yarp::os::setEnergySavingModeState ( bool  enabled)

Toggle the OS energy saving feature.

This function toggle the state of the energy saving feature that may affect YARP calls.

For example, in macOS this function toggles the state of the AppNap feature, which put the process into an idle state.

Parameters
enabletrue if the energy saving mode should be enabled. False otherwise.

Definition at line 112 of file Os.cpp.

◆ setprogname()

void yarp::os::setprogname ( const char *  progname)

Portable wrapper for the setprogname() function.

Set the program name.

Parameters
[in]prognamethe program name
Deprecated:
Since YARP 3.0.0.

Definition at line 128 of file Os.cpp.

◆ stat()

int yarp::os::stat ( const char *  path)

Portable wrapper for the stat() function.

Get file status.

Parameters
[in]

Definition at line 87 of file Os.cpp.