ConverterHostHardwareAddress.h

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 
00003 #ifndef CONVERTER_HOST_HARDWARE_ADDRESS_H_
00004 #define CONVERTER_HOST_HARDWARE_ADDRESS_H_
00005 
00006 #include <fesa-core/DataStore/Converter.h>
00007 #include <fesa-core/DataStore/TypeDefinition.h>
00008 #include <fesa-core/Utilities/StringUtilities.h>
00009 
00010 #include <string>
00011 #include <cstring>
00012 
00013 namespace fesa
00014 {
00015 
00021 template<>
00022 class Converter<HostHardwareAddress_DataType>
00023 {
00024   public:
00030     static void valueToString(HostHardwareAddress_DataType& value, std::string& str);
00031 
00037     static void stringToValue(const std::string& value, HostHardwareAddress_DataType* pVal);
00038 
00039 };
00040 
00041 inline void Converter<HostHardwareAddress_DataType>::valueToString(HostHardwareAddress_DataType& value,std::string& str)
00042 {
00043 
00044     std::string host(value.host_);
00045 
00046     str = host;
00047 }
00048 
00049 inline void Converter<HostHardwareAddress_DataType>::stringToValue(const std::string& value,
00050                                                                    HostHardwareAddress_DataType* pVal)
00051 {
00052 
00053     std::strcpy(pVal->host_, value.c_str());
00054 
00055 }
00056 
00057 } // fesa
00058 
00059 #endif // CONVERTER_HOST_HARDWARE_ADDRESS_H_

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1