VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Typedefs | Enumerations | Functions | Variables
jrm Namespace Reference

Classes

class  DebugStreamAdapter
 This class implements a mechanism that logs to an arbitrary ostream. More...
class  JrmException
 Class that defines a basic exception class which behaves the same way on Windows/Linux. More...
struct  MacAddress
 Type representing a Media Access Control (MAC) address. More...
struct  EthAdapterInfo
 Describes an Ethernet adapter. More...
class  TerminalApp
 This class factors some functionality useful for command-line terminal applications (may also be used by GUI apps): More...

Typedefs

typedef uint8_t MacValueType
 Type representing a single component (octet) of a Media Access Control (MAC) address.
typedef std::vector< MacValueTypeMacAddressBase
 Type used as the base class for the MacAddress type, declared separately for convenience.

Enumerations

enum  DebugLevel {
  DebugLevel_Off, DebugLevel_UseGlobal, DebugLevel_LogError, DebugLevel_LogCritical,
  DebugLevel_LogWarning, DebugLevel_LogInfo, DebugLevel_Debug1, DebugLevel_Debug2,
  DebugLevel_Debug3, DebugLevel_Debug4, DebugLevel_Debug5, DebugLevel_CustomBase
}
 Defines debug levels having special meaning. More...

Functions

JrmUtilsDllLinkage std::string ToString (const DebugLevel &value)
 Returns a human-readable string representation of the given value.
bool JrmUtilsDllLinkage GetEthAdapterInfo (std::vector< EthAdapterInfo > &out)
 Lists information about the Ethernet adapters installed on the system.
template<typename IntT >
std::string ToBaseString (const IntT &in, const int &base, const bool showBase=true, const int &width=0, const char &fill= '0')
 Converts the given integral type into a string using the given numeric base (i.e.
template<typename IntT >
IntT Bits (const IntT &mask, const size_t &begin, const size_t &length)
 Returns the value represented by the specified range of contiguous bits within the given mask.

Variables

static DebugLevel ModuleDebugLevel = DebugLevel_UseGlobal
 Threshold value used to control debug code execution and logging verbosity for the current "module" (i.e.
JrmUtilsDllLinkage DebugLevel GlobalDebugLevel
 Threshold value used to control debug code execution and logging verbosity for any module whose module-relative debug level is set to DebugLevel_UseGlobal.

Typedef Documentation

Type representing a single component (octet) of a Media Access Control (MAC) address.

typedef std::vector<MacValueType> jrm::MacAddressBase

Type used as the base class for the MacAddress type, declared separately for convenience.

Enumeration Type Documentation

Defines debug levels having special meaning.

Enumerator:
DebugLevel_Off 

Never execute debugging code.

DebugLevel_UseGlobal 

Use the global debug level.

DebugLevel_LogError 

Log error messages only.

DebugLevel_LogCritical 

Log critical messages and lower. A critical message is important but not necessarily an error.

DebugLevel_LogWarning 

Log warning messages and lower.

DebugLevel_LogInfo 

Log info messages and lower.

DebugLevel_Debug1 

Execute statements at this level and lower.

DebugLevel_Debug2 

Execute statements at this level and lower.

DebugLevel_Debug3 

Execute statements at this level and lower.

DebugLevel_Debug4 

Execute statements at this level and lower.

DebugLevel_Debug5 

Execute statements at this level and lower.

DebugLevel_CustomBase 

Beginning of the "custom" debug level range. None should be greater.

Function Documentation

JrmUtilsDllLinkage std::string jrm::ToString ( const DebugLevel &  value)

Returns a human-readable string representation of the given value.

bool JrmUtilsDllLinkage jrm::GetEthAdapterInfo ( std::vector< EthAdapterInfo > &  out)

Lists information about the Ethernet adapters installed on the system.

Parameters
[out]outUpon success, contains one objects for each Ethernet adapter found. Any existing contents are cleared.
Returns
True iff successful.
Warning
Destructive to content in out.
template<typename IntT >
std::string jrm::ToBaseString ( const IntT &  in,
const int base,
const bool  showBase = true,
const int width = 0,
const char &  fill = '0' 
)

Converts the given integral type into a string using the given numeric base (i.e.

radix).

Template Parameters
IntTAny integral type, e.g. int, unsigned int, int32_t, uint32_t, etc.
Parameters
[in]inInteger to convert to a string.
[in]baseNumeric base (i.e. radix) to use for the conversion. Valid values are: 8, 10, 16.
[in]showBaseFlag indicating if the numeric base should be represented as a prefix in the converted string, e.g.: "0x" for base 16.
[in]widthMinimum number of digits to be written, padding on the left (following any base prefix) with fill characters as needed.
[in]fillThe fill character used as padding to meet the specified width.
Returns
String representation of the given integral type.
template<typename IntT >
IntT jrm::Bits ( const IntT &  mask,
const size_t &  begin,
const size_t &  length 
)

Returns the value represented by the specified range of contiguous bits within the given mask.

    Bits are indexed starting at zero from least-to-most significant, e.g. for a uint32_t 31...0.
    For example:  Extracting bits 16-19 (begin=16, length=4) of 0x000F0000 results in value 0xF = 15.
Warning
Throws a std::out_of_range exception when the specified bit range is out-of-bounds relative to the given mask type.
Template Parameters
IntTAny integral type, e.g. int, unsigned int, int32_t, uint32_t, etc.
Parameters
[in]maskThe mask from which to extract the value for the given bit range.
[in]beginZero-based index of the first bit in the range.
[in]lengthNumber of contiguous bits, starting at and including the one indexed by begin, for which to extract the value.
Returns
The value of the specified bits.

Variable Documentation

DebugLevel jrm::ModuleDebugLevel = DebugLevel_UseGlobal
static

Threshold value used to control debug code execution and logging verbosity for the current "module" (i.e.

compilation unit). The higher this value is set, the more debugging code is run and the more verbose the log. A value of jrm::DebugLevel_Off turns debugging off for the module - neither debug statements nor log statements will be run.

Note
Use the macros provided above for checking this value. You may modify it directly as needed.
This is intentionally declared static to make it relative to each compilation unit that includes this file . The default value means to use whatever the global debug level is.
JrmUtilsDllLinkage DebugLevel jrm::GlobalDebugLevel

Threshold value used to control debug code execution and logging verbosity for any module whose module-relative debug level is set to DebugLevel_UseGlobal.

    A value of jrm::DebugLevel_Off turns debugging off for such modules - neither debug statements nor log statements will be run.
Note
Use the macros provided above for checking this value. You may modify it directly as needed, usually from main().
The default value means to log messages starting at the "info" level, and to run no debug code.


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)