00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #include <fesa-core/DataStore/AbstractDevice.h> 00004 00005 namespace fesa 00006 { 00007 00008 AbstractDevice::AbstractDevice() : 00009 name("name", this, DEVICE_NAME_LENGTH), mainMuxCriterion("mainMuxCriterion", this, FIELD_STRING_LENGTH), 00010 timingDomain("timingDomain", this, FIELD_STRING_LENGTH) 00011 { 00012 } 00013 00014 void AbstractDevice::initialize() 00015 { 00016 if (isLoggable_ == 0) 00017 { 00018 throw; 00019 } 00020 *isLoggable_ = false; 00021 } 00022 00023 const std::string AbstractDevice::getName() 00024 { 00025 return name.get(); 00026 } 00027 00028 AbstractDevice::~AbstractDevice() 00029 { 00030 00031 } 00032 00033 bool AbstractDevice::isMultiplexed() 00034 { 00035 return strcmp(mainMuxCriterion.get(), "NONE") != 0; 00036 } 00037 00038 int32_t AbstractDevice::getSizeOfAdditionalFields() 00039 { 00040 int32_t size = DataStore::getSizeOfAdditionalFields(); 00041 size += static_cast<int32_t>(sizeof(bool)); // isLoggable_ 00042 return size; 00043 } 00044 00045 void AbstractDevice::mapAdditionalFields(char* p) 00046 { 00047 DataStore::mapAdditionalFields(p); 00048 p += DataStore::getSizeOfAdditionalFields(); 00049 isLoggable_ = (bool*) p; 00050 } 00051 00052 } // fesa