libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
BaseLib::DeviceDescription::DeviceTranslations Class Reference

Class to work with translations of device description files of one device family. More...

#include <DeviceTranslations.h>

Public Member Functions

 DeviceTranslations (BaseLib::SharedObjects *baseLib, int32_t family)
 
virtual ~DeviceTranslations ()=default
 
void clear ()
 
PVariable getTypeDescription (const std::string &filename, const std::string &language, const std::string &deviceId)
 
PVariable getTypeLongDescription (const std::string &filename, const std::string &language, const std::string &deviceId)
 
PVariable getParameterLabel (const std::string &filename, const std::string &language, ParameterGroup::Type::Enum parameterGroupType, const std::string &parameterGroupId, const std::string &parameterId)
 
PVariable getParameterDescription (const std::string &filename, const std::string &language, ParameterGroup::Type::Enum parameterGroupType, const std::string &parameterGroupId, const std::string &parameterId)
 

Protected Member Functions

std::unordered_set< std::string > getLanguages ()
 
std::unordered_map< std::string, PHomegearDeviceTranslationgetTranslations (const std::string &filename)
 
PHomegearDeviceTranslation getTranslation (const std::string &filename, const std::string &language)
 
PHomegearDeviceTranslation load (const std::string &filename, const std::string &language)
 

Protected Attributes

BaseLib::SharedObjects_bl = nullptr
 
int32_t _family = -1
 
std::mutex _deviceTranslationsMutex
 
std::unordered_map< std::string, std::unordered_map< std::string, PHomegearDeviceTranslation > > _deviceTranslations
 

Detailed Description

Class to work with translations of device description files of one device family.

It is used to load all translations and retrieve the translation of a device.

Constructor & Destructor Documentation

§ DeviceTranslations()

BaseLib::DeviceDescription::DeviceTranslations::DeviceTranslations ( BaseLib::SharedObjects baseLib,
int32_t  family 
)

§ ~DeviceTranslations()

virtual BaseLib::DeviceDescription::DeviceTranslations::~DeviceTranslations ( )
virtualdefault

Member Function Documentation

§ clear()

void BaseLib::DeviceDescription::DeviceTranslations::clear ( )

§ getLanguages()

std::unordered_set< std::string > BaseLib::DeviceDescription::DeviceTranslations::getLanguages ( )
protected

§ getParameterDescription()

PVariable BaseLib::DeviceDescription::DeviceTranslations::getParameterDescription ( const std::string &  filename,
const std::string &  language,
ParameterGroup::Type::Enum  parameterGroupType,
const std::string &  parameterGroupId,
const std::string &  parameterId 
)

§ getParameterLabel()

PVariable BaseLib::DeviceDescription::DeviceTranslations::getParameterLabel ( const std::string &  filename,
const std::string &  language,
ParameterGroup::Type::Enum  parameterGroupType,
const std::string &  parameterGroupId,
const std::string &  parameterId 
)

§ getTranslation()

PHomegearDeviceTranslation BaseLib::DeviceDescription::DeviceTranslations::getTranslation ( const std::string &  filename,
const std::string &  language 
)
protected

§ getTranslations()

std::unordered_map< std::string, PHomegearDeviceTranslation > BaseLib::DeviceDescription::DeviceTranslations::getTranslations ( const std::string &  filename)
protected

§ getTypeDescription()

PVariable BaseLib::DeviceDescription::DeviceTranslations::getTypeDescription ( const std::string &  filename,
const std::string &  language,
const std::string &  deviceId 
)

§ getTypeLongDescription()

PVariable BaseLib::DeviceDescription::DeviceTranslations::getTypeLongDescription ( const std::string &  filename,
const std::string &  language,
const std::string &  deviceId 
)

§ load()

std::shared_ptr< HomegearDeviceTranslation > BaseLib::DeviceDescription::DeviceTranslations::load ( const std::string &  filename,
const std::string &  language 
)
protected

Member Data Documentation

§ _bl

BaseLib::SharedObjects* BaseLib::DeviceDescription::DeviceTranslations::_bl = nullptr
protected

§ _deviceTranslations

std::unordered_map<std::string, std::unordered_map<std::string, PHomegearDeviceTranslation> > BaseLib::DeviceDescription::DeviceTranslations::_deviceTranslations
protected

§ _deviceTranslationsMutex

std::mutex BaseLib::DeviceDescription::DeviceTranslations::_deviceTranslationsMutex
protected

§ _family

int32_t BaseLib::DeviceDescription::DeviceTranslations::_family = -1
protected

The documentation for this class was generated from the following files: