YARP
Yet Another Robot Platform
yarp::os Namespace Reference

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

Namespaces

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

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  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  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  LogComponent
 
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  ModifyingCarrier
 A starter class for implementing simple modifying carriers. More...
 
class  MonitorObject
 
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
 An abstraction for a periodic thread. More...
 
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  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  PortWriterBufferBase
 
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  RFModuleFactory
 
class  RFPlugin
 
class  RosNameSpace
 
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  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  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  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...
 
std::string gethostname ()
 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 ()
 Portable wrapper for the fork() function. More...
 
constexpr yarp::conf::vocab32_t createVocab (char a, char b=0, char c=0, char d=0)
 

Detailed Description

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

Typedef Documentation

◆ ConstString

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

Definition at line 26 of file ConstString.h.

◆ LockGuard

Definition at line 95 of file LockGuard.h.

◆ NetFloat32

Definition of the NetFloat32 type.

Definition at line 45 of file NetFloat32.h.

◆ NetFloat64

Definition of the NetFloat64 type.

Definition at line 45 of file NetFloat64.h.

◆ NetInt16

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

Definition of the NetInt16 type.

Definition at line 33 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 33 of file NetInt32.h.

◆ NetInt64

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

Definition of the NetInt64 type.

Definition at line 33 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 33 of file NetUint16.h.

◆ NetUint32

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

Definition of the NetUint32 type.

Definition at line 33 of file NetUint32.h.

◆ NetUint64

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

Definition of the NetInt64 type.

Definition at line 33 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 28 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 
)
constexpr

Definition at line 22 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 162 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 115 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
Deprecated:
since YARP 3.4.0. Use std::getenv instead.

Definition at line 34 of file Os.cpp.

◆ gethostname() [1/2]

std::string yarp::os::gethostname ( )

Portable wrapper for the gethostname() function.

Returns the hostname as string

Returns
hostname the system hostname

Definition at line 108 of file Os.cpp.

◆ gethostname() [2/2]

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 100 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 94 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 146 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 40 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 45 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 83 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 78 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 120 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 136 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 88 of file Os.cpp.