Robox Library for Cpp: BCC/31 module 1.0.0
RLibCpp BCC/31 protocol implementation
Public Types | Static Public Member Functions | List of all members
Globals Class Reference

Global variable and methods declaration. More...

#include <globals.h>

Public Types

enum  Results {
  resSuccess = 0 , resError = 1 , resInternalError = -2 , resNoData = -3 ,
  resDataError = -4 , resArgumentError = -5 , resQueueEmpty = -6 , resQueueFull = -7 ,
  resAborted = -8 , resTimeoutError = -9 , resReceiveError = -10 , resTransmitError = -11 ,
  resNotImplemented = -12 , resNotSupported = -13 , resRouteTableMissing = -14 , resRouteNotFound = -15 ,
  resRouteAlreadyExists = -16 , resRouteReserved = -17 , resRouteError = -18 , resReplyNotSupported = -19 ,
  resInvalidTargetId = -20 , resInvalidTargetCh = -21 , resInvalidSourceId = -22 , resInvalidSourceCh = -23 ,
  resInvalidLink = -24 , resInvalidClient = -25 , resLinkActive = -26 , resLinkNotActive = -27 ,
  resLinkCacheError = -28 , resLinkNotFound = -29 , resLinkReconnecting = -30 , resOutOfClients = -31 ,
  resOutOfMemory = -32 , resClientNotFound = -33 , resOutQueueMissing = -34 , resInQueueMissing = -35 ,
  resClientNotConnected = -36 , resClientConnected = -37 , resClientDisconnected = -38 , resInvalidData = -39 ,
  resManagerActive = -40 , resManagerNotActive = -41 , resEncodeError = -42 , resDecodeError = -43 ,
  resDeviceWriteError = -44 , resDeviceReadError = -45 , resConnectionActive = -46 , resConnectionNotActive = -47 ,
  resConnectionManagerError = -48 , resSourceChUsed = -49 , resSourceNotFound = -50 , resSourceOpenError = -51 ,
  resSourceReadError = -52 , resSourceSizeTooBig = -53 , resTargetOpenError = -54 , resTargetReadError = -55 ,
  resTargetWriteError = -56 , resTargetExistError = -57 , resTargetBackupError = -58 , resRemoteError = -59 ,
  resRemoteAbort = -60 , resVarNameParseError = -61 , resInvalidVarType = -62 , resInvalidVarSize = -63 ,
  resInvalidVarIndex = -64 , resInvalidVarCount = -65 , resInvalidVarAxIndex = -66 , resInvalidVarAxCount = -67 ,
  resInvalidVarBitIndex = -68 , resInvalidVarOperation = -69 , resMissingValues = -70 , resTooManyValues = -71 ,
  resDataOverflow = -72 , resDataUnderflow = -73 , resNoOperationRunning = -74 , resSeqMismatch = -76 ,
  resOffsetMismatch = -77 , resSizeMismatch = -78 , resCrossThreadingError = -89 , resVarCacheRemoveError = -90 ,
  resVarCacheNotFound = -91 , resVtxFileLoadError = -92 , resHardwareVarFillError = -93 , resRemoteVarFillError = -94 ,
  resMonitorNotFound = -500 , resMonitorNotActive = -501 , resMonitorActive = -502 , resMonitorNotCreated = -503 ,
  resMonitorCreated = -504 , resMonitorDataSizeMismatch = -505 , resMonitorVarSetIdChanged = -506 , resMonitorDataTimeoutError = -507 ,
  resMonitorServiceTimeoutError = -508 , resOscilloscopeNotActive = -600 , resOscilloscopeActive = -601 , resOscilloscopeNotFound = -602 ,
  resOscilloscopeDataSizeMismatch = -603 , resOscilloscopeVarSetIdChanged = -604 , resOscilloscopeDataTimeoutError = -605 , resOscilloscopeServiceTimeoutError = -606
}
 The global operation result codes. More...
 

Static Public Member Functions

static RLibCpp::Tool::String DecodeResult (Results re)
 Decode the specified result code.
 
static RLibCpp::Tool::String tr (const RLibCpp::Tool::String &src)
 Get the translation into the current language.
 
static void setLocale (const RLibCpp::Tool::String &locale)
 Set the locale information for this assembly.
 
static RLibCpp::Tool::String locale ()
 Get the setted local for this assembly.
 
static void setLocalePath (const RLibCpp::Tool::String &path)
 Set the locale library messages root path.
 
static RLibCpp::Tool::String localePath ()
 Get the locale library messages root path.
 

Detailed Description

Global variable and methods declaration.

Member Enumeration Documentation

◆ Results

enum Results

The global operation result codes.

Enumerator
resSuccess 

The operation completed successfully.

resError 

The operation failed due to a generic error.

resInternalError 

The operation ended with an internal error.

resNoData 

No data available.

resDataError 

Generic error in data.

resArgumentError 

Generic error in the arguments .

resQueueEmpty 

The queue is empty.

resQueueFull 

The queue is full.

resAborted 

The operation has been aborted.

resTimeoutError 

Error in timeout or timeout expired.

resReceiveError 

Error receiving data.

resTransmitError 

Error transmitting data.

resNotImplemented 

The operation is not implemented.

resNotSupported 

The operation is not supported.

resRouteTableMissing 

The route table is missing.

resRouteNotFound 

The route has not been found.

resRouteAlreadyExists 

The route already exists.

resRouteReserved 

The route is reserved.

resRouteError 

Generic error in route.

resReplyNotSupported 

The reply is not supported.

resInvalidTargetId 

The target ID is not valid.

resInvalidTargetCh 

The target channel is not valid.

resInvalidSourceId 

The source ID is not valid.

resInvalidSourceCh 

The source channel is not valid.

resInvalidLink 

The link is not valid.

resInvalidClient 

The client is not valid.

resLinkActive 

The link is active (expected not active).

resLinkNotActive 

The link is not active (expected active).

resLinkCacheError 

Generic error in link cache.

resLinkNotFound 

The link has not been found.

resLinkReconnecting 

The link is reconnecting (busy).

resOutOfClients 

No more communication clients availables.

resOutOfMemory 

No more memory available.

resClientNotFound 

The client has not been found.

resOutQueueMissing 

The output queue is missing.

resInQueueMissing 

The input queue is missing.

resClientNotConnected 

The client is not connected (expected connected).

resClientConnected 

The client is connected (expected not connected).

resClientDisconnected 

The client has been disconnected.

resInvalidData 

The data is not valid.

resManagerActive 

The manager is active (expected not active).

resManagerNotActive 

The manager is not active (expected active).

resEncodeError 

Generic error encoding.

resDecodeError 

Generic error decoding.

resDeviceWriteError 

Generic error writing to the device.

resDeviceReadError 

Generic error reading form the device.

resConnectionActive 

The connection is active (expected not active).

resConnectionNotActive 

The connection is not active (expected active).

resConnectionManagerError 

Generic error in connection manager.

resSourceChUsed 

The source channel is used.

resSourceNotFound 

The source has not been found.

resSourceOpenError 

Generic error opening the source.

resSourceReadError 

Generic error reading the source.

resSourceSizeTooBig 

The source size is too big to be handled.

resTargetOpenError 

Generic error opening the target.

resTargetReadError 

Generic error reading the target.

resTargetWriteError 

Generic error writing the target.

resTargetExistError 

Generic error while checking the target existence.

resTargetBackupError 

Generic error while backing up the target.

resRemoteError 

operation ended due to a error on the connected device

When the OperatioData structure is available (or used), properties NackErrCode and NackErrExtra will contains details about the error.

resRemoteAbort 

The operation aborted by the connected device.

When the OperatioData structure is available (or used), its properties NackErrCode and NackErrExtra will contains details about the error.

resVarNameParseError 

Error parsing the variable name.

resInvalidVarType 

Invalid (or unssuported) variable type/.

resInvalidVarSize 

Invalid variable size.

resInvalidVarIndex 

Invalid variable index.

resInvalidVarCount 

Invalid variable count.

resInvalidVarAxIndex 

Invalid variable axis index.

resInvalidVarAxCount 

Invalid variable axis count.

resInvalidVarBitIndex 

Invalid variable bit index.

resInvalidVarOperation 

Invalid variable operation.

resMissingValues 

Missing values.

resTooManyValues 

Too many values.

resDataOverflow 

Too much data than the maximum required.

resDataUnderflow 

Few data than minimum required.

resNoOperationRunning 

No operation is running.

resSeqMismatch 

Data sequence mismatch in a data stream operation.

resOffsetMismatch 

Data offset mismatch in a data stream operation.

resSizeMismatch 

Data size mismatch in a data stream operation.

resCrossThreadingError 

Cross thread usage not allowed.

resVarCacheRemoveError 

Error removing from cache : the specified Id was not found in variable cache.

resVarCacheNotFound 

Error getting variable : the specified Id was not found in variable cache.

resVtxFileLoadError 

Error loading the VTX file.

resHardwareVarFillError 

Error filling hardware variable definitions.

resRemoteVarFillError 

Error filling remote variable definitions.

resMonitorNotFound 

The monitor has not been found.

resMonitorNotActive 

Oscilloscope not active (expected active).

resMonitorActive 

Monitor active (expected not active).

resMonitorNotCreated 

Monitor not created (expected created).

resMonitorCreated 

Monitor created (expected not created).

resMonitorDataSizeMismatch 

The monitor data size returned from the device doesn't match the expected value.

resMonitorVarSetIdChanged 

The device variable set ID has changed since the monitor start.

resMonitorDataTimeoutError 

A timeout error on monitor data has occurred.

resMonitorServiceTimeoutError 

A timeout error on monitor service has occurred.

resOscilloscopeNotActive 

Oscilloscope not active (expected active).

resOscilloscopeActive 

Oscilloscope active (expected not active).

resOscilloscopeNotFound 

The oscilloscope has not been found.

resOscilloscopeDataSizeMismatch 

The oscilloscope data size returned from the device doesn't match the expected value.

resOscilloscopeVarSetIdChanged 

The device varset identifier has changed since the oscilloscope start.

resOscilloscopeDataTimeoutError 

A timeout on oscilloscope data has occurred.

resOscilloscopeServiceTimeoutError 

A timeout on oscilloscope service has occurred.

Member Function Documentation

◆ DecodeResult()

static RLibCpp::Tool::String DecodeResult ( Results re)
static

Decode the specified result code.

Parameters
reThe result code.
Returns
Return the successfully decoded string, or "" otherwise.

The result code will be decoded, using the current culture

◆ locale()

static RLibCpp::Tool::String locale ( )
static

Get the setted local for this assembly.

Returns
The actual setted locale

◆ localePath()

static RLibCpp::Tool::String localePath ( )
static

Get the locale library messages root path.

Returns
The actual locale library messages root path.

◆ setLocale()

static void setLocale ( const RLibCpp::Tool::String & locale)
static

Set the locale information for this assembly.

Parameters
localeThe locale value: the value can be in the form "language" or "language_countryRegion" or or "language_countryRegion.UTF8".

The 'countryRegion' part is significant only for the RLibCpp::Tool::String operation on your strings' values (formerly for RLibCpp::Tool::String::toUpper and RLibCpp::Tool::String::toLower operations)

For the library internal messege translation , only the 'language' part is significant: valid values can be found into the etc/locale folder. Any other value will defaults to "en"

Any invalid combination of "language_countryRegion" will cause a runtime error on some platforms

The default assigned value is "en_US.UTF8"

If the setted locale was not found then the "en" default translation will be used

The setted locale value will only affects the output translated messages and some methods of the String class ( formerly String::toLower(), String::toUpper() )

this methods also invokes the RLibCpp:.Globals::setLocale()

The setted language vakues, also affects the locale for the Vtx file, so it's advisable to set the locale before the creation of any Connection object

◆ setLocalePath()

static void setLocalePath ( const RLibCpp::Tool::String & path)
static

Set the locale library messages root path.

This is the folder where the library locale message reside. The default path in the distribution package is etc/locale

Parameters
pathThe rooth path for the library locale translations

If not setted , the default value is "../etc/locale" relative to the calling application working directory

◆ tr()

static RLibCpp::Tool::String tr ( const RLibCpp::Tool::String & src)
static

Get the translation into the current language.

Parameters
srcThe source string to translate
Returns
The tranbslated string