MeVisLab Toolbox Reference
CreateDefaultDeviceSerialNumber Struct Reference

Helper class to returning a value usable as device serial number. More...

#include <mlDefaultValueCreators.h>

Inheritance diagram for CreateDefaultDeviceSerialNumber:
DefaultValueCreatorBase

Public Member Functions

 CreateDefaultDeviceSerialNumber ()
 Constructor enabling all subcomponents and initializing prefix with "SN" (for serial number) and postfix with "FM" (for Fraunhofer MEVIS).
 
std::string createDefaultValue () const override
 Creates and returns a serial number composed from prefix, getMeVisLabVersion(), getPlatform(), getCompiler(), getBitness), getMAC(), and postfix if the corresponding components are enabled.
 
- Public Member Functions inherited from DefaultValueCreatorBase
virtual ~DefaultValueCreatorBase ()
 Virtual destructor.
 

Static Public Member Functions

static std::string getMeVisLabVersion ()
 Returns the MeVisLab version code such as "305" for MeVisLab 3.5.
 
static std::string getPlatform ()
 Returns "0" for unknown, "1" for Windows, "2" for Linux, "3" for MACOS.
 
static std::string getCompiler ()
 MSC: "1-" + MSCVER gcc: "2-" + gcc-mayor+"."+gcc-minor+"."+gcc-patchlevel (or 0 if not available) apple-clang: "3-" + clang_version other clang: "4-" + clang_version
 
static std::string getBitness ()
 Returns "64" on 64 bit systems and "32" on 32 bit systems.
 
static std::string getMAC ()
 Tries to create a decimal coded MAC address or returns "0" instead.
 

Public Attributes

std::string separator
 Separator string between components of generated serial numbers.
 
std::string prefix
 Prefix to be added at begin of the created serial number.
 
bool addMeVisLabVersion
 Adds MeVisLab version definition if true.
 
bool addPlatform
 Adds a platform code if true, see getPlatform for details.
 
bool addCompiler
 Adds a compiler version code, see getCompiler() for details.
 
bool addBitness
 Adds 32 or 64 according to processor bitness.
 
bool addMAC
 Adds the MAC address if true; see getMAC() for details.
 
std::string postfix
 Prefix to be appended at end the created serial number.
 

Protected Member Functions

void _addSeparatated (std::string &inStr, const std::string &suffix) const
 Appends separator + suffix to inStr if inStr is not empty, otherwise only suffix is added.
 

Detailed Description

Helper class to returning a value usable as device serial number.

Definition at line 44 of file mlDefaultValueCreators.h.

Constructor & Destructor Documentation

◆ CreateDefaultDeviceSerialNumber()

CreateDefaultDeviceSerialNumber::CreateDefaultDeviceSerialNumber ( )

Constructor enabling all subcomponents and initializing prefix with "SN" (for serial number) and postfix with "FM" (for Fraunhofer MEVIS).

Member Function Documentation

◆ _addSeparatated()

void CreateDefaultDeviceSerialNumber::_addSeparatated ( std::string & inStr,
const std::string & suffix ) const
protected

Appends separator + suffix to inStr if inStr is not empty, otherwise only suffix is added.

◆ createDefaultValue()

std::string CreateDefaultDeviceSerialNumber::createDefaultValue ( ) const
overridevirtual

Creates and returns a serial number composed from prefix, getMeVisLabVersion(), getPlatform(), getCompiler(), getBitness), getMAC(), and postfix if the corresponding components are enabled.

All components are separated by separator.

Implements DefaultValueCreatorBase.

◆ getBitness()

static std::string CreateDefaultDeviceSerialNumber::getBitness ( )
static

Returns "64" on 64 bit systems and "32" on 32 bit systems.

◆ getCompiler()

static std::string CreateDefaultDeviceSerialNumber::getCompiler ( )
static

MSC: "1-" + MSCVER gcc: "2-" + gcc-mayor+"."+gcc-minor+"."+gcc-patchlevel (or 0 if not available) apple-clang: "3-" + clang_version other clang: "4-" + clang_version

◆ getMAC()

static std::string CreateDefaultDeviceSerialNumber::getMAC ( )
static

Tries to create a decimal coded MAC address or returns "0" instead.

◆ getMeVisLabVersion()

static std::string CreateDefaultDeviceSerialNumber::getMeVisLabVersion ( )
static

Returns the MeVisLab version code such as "305" for MeVisLab 3.5.

◆ getPlatform()

static std::string CreateDefaultDeviceSerialNumber::getPlatform ( )
static

Returns "0" for unknown, "1" for Windows, "2" for Linux, "3" for MACOS.

Member Data Documentation

◆ addBitness

bool CreateDefaultDeviceSerialNumber::addBitness

Adds 32 or 64 according to processor bitness.

Definition at line 90 of file mlDefaultValueCreators.h.

◆ addCompiler

bool CreateDefaultDeviceSerialNumber::addCompiler

Adds a compiler version code, see getCompiler() for details.

Definition at line 87 of file mlDefaultValueCreators.h.

◆ addMAC

bool CreateDefaultDeviceSerialNumber::addMAC

Adds the MAC address if true; see getMAC() for details.

Definition at line 93 of file mlDefaultValueCreators.h.

◆ addMeVisLabVersion

bool CreateDefaultDeviceSerialNumber::addMeVisLabVersion

Adds MeVisLab version definition if true.

Definition at line 81 of file mlDefaultValueCreators.h.

◆ addPlatform

bool CreateDefaultDeviceSerialNumber::addPlatform

Adds a platform code if true, see getPlatform for details.

Definition at line 84 of file mlDefaultValueCreators.h.

◆ postfix

std::string CreateDefaultDeviceSerialNumber::postfix

Prefix to be appended at end the created serial number.

Definition at line 96 of file mlDefaultValueCreators.h.

◆ prefix

std::string CreateDefaultDeviceSerialNumber::prefix

Prefix to be added at begin of the created serial number.

Definition at line 78 of file mlDefaultValueCreators.h.

◆ separator

std::string CreateDefaultDeviceSerialNumber::separator

Separator string between components of generated serial numbers.

Definition at line 74 of file mlDefaultValueCreators.h.


The documentation for this struct was generated from the following file: