This class is responsible for create and initialize the data memory space into shared-memory space:
#include <ShmFactory.h>
Public Member Functions | |
ShmFactory (const std::string &className) | |
generates the shared-memory name (base on device-class name) | |
bool | setUpMemory () |
creates the Shared-memory, maps and initializes all the fields | |
void | createSharedMemory () |
allocates shared memory-space relying on device data size | |
bool | attachSharedMemory (int32_t fd) |
retrieves existing shared memory space and attachs to it. | |
void | removeSharedMemory () |
deletes shared memory-space | |
Public Attributes | |
ShmHeader_t * | pShmHeader_ |
pointer to ShmHeader structure | |
int32_t | shmSize_ |
size of share memory segment | |
std::string | shmName_ |
name of share memory segment | |
char * | pAddrMuxManagersSpace_ |
char * | pAddrDeviceInstanceSpace_ |
address at which the device objects start | |
char * | pAddrGlobalDeviceSpace_ |
address at which the global device objects start | |
char * | pAddrDomainStoreSpace_ |
address at which the domain store objects start | |
char * | pAddrEquipmentDataSpace_ |
address at which the equipment data starts | |
Static Private Attributes | |
static CMW::Log::Logger & | logger_ = CMW::Log::LoggerFactory::getLogger("FESA.FWK.fesa-core.DataStore.ShmFactory") |
This class is responsible for create and initialize the data memory space into shared-memory space:
Definition at line 46 of file ShmFactory.h.
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::ShmFactory | ( | const std::string & | className | ) | [inline] |
generates the shared-memory name (base on device-class name)
className | the name of the class |
Definition at line 135 of file ShmFactory.h.
References fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_.
bool fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory | ( | int32_t | fd | ) | [inline] |
retrieves existing shared memory space and attachs to it.
fd | file descriptor of the shm |
Definition at line 349 of file ShmFactory.h.
References fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::computeMemorySize(), fesa::ShmHeader_t::devicesSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::devicesSize_, fesa::ShmHeader_t::domainStoreSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::domainStoreSize_, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::equimentDataSize_, fesa::ShmHeader_t::equipmentSize, FesaErrorMappingSharedMemory, FesaErrorUnMappingSharedMemory, fesa::ShmHeader_t::globalDeviceSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::globalDeviceSize_, fesa::ShmHeader_t::muxManagersSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::muxManagersSize_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDeviceInstanceSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDomainStoreSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrEquipmentDataSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrGlobalDeviceSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrMuxManagersSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pShmHeader_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_, fesa::ShmHeader_t::shmSize, and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmSize_.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory().
void fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory | ( | ) | [inline] |
allocates shared memory-space relying on device data size
Definition at line 293 of file ShmFactory.h.
References fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::computeMemorySize(), fesa::ShmHeader_t::devicesSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::devicesSize_, fesa::ShmHeader_t::domainStoreSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::domainStoreSize_, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::equimentDataSize_, fesa::ShmHeader_t::equipmentSize, FesaErrorCreatingSharedMemory, FesaErrorMappingSharedMemory, FesaErrorResizingSharedMemory, fesa::ShmHeader_t::globalDeviceSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::globalDeviceSize_, fesa::ShmHeader_t::muxManagersSize, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::muxManagersSize_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDeviceInstanceSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDomainStoreSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrEquipmentDataSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrGlobalDeviceSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrMuxManagersSpace_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pShmHeader_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_, fesa::ShmHeader_t::shmSize, and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmSize_.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory().
void fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory | ( | ) | [inline] |
deletes shared memory-space
Definition at line 142 of file ShmFactory.h.
References FesaErrorRemovingSharedMemory, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::logger_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pShmHeader_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_, and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmSize_.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory().
bool fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory | ( | ) | [inline, virtual] |
creates the Shared-memory, maps and initializes all the fields
Implements fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >.
Definition at line 163 of file ShmFactory.h.
References fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory(), fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::devicesSize_, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::domainStoreSize_, FesaErrorNoPermissionToSendSignals, FesaErrorOpeningSharedMemory, FesaErrorShmFactorySettingUpMemory, fesa::FesaException::getFileName(), fesa::EquipmentData::getInstance(), fesa::AbstractEquipment::getInstance(), fesa::FesaException::getLineNumber(), fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::globalDeviceSize_, fesa::EquipmentData::isInitialize_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::logger_, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::mapFields(), fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::muxManagersSize_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrMuxManagersSpace_, fesa::Semaphore::post(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory(), fesa::EquipmentData::rtProcessID_, fesa::EquipmentData::serverProcessID_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_, fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmSize_, fesa::SIGFESA_CHECK_PROCESS_ALIVE, fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::unmapFields(), and fesa::Semaphore::wait().
CMW::Log::Logger & fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::logger_ = CMW::Log::LoggerFactory::getLogger("FESA.FWK.fesa-core.DataStore.ShmFactory") [inline, static, private] |
Definition at line 126 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory().
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDeviceInstanceSpace_ |
address at which the device objects start
Definition at line 106 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory().
char* fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDomainStoreSpace_ |
address at which the domain store objects start
Definition at line 117 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory().
char* fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrEquipmentDataSpace_ |
address at which the equipment data starts
Definition at line 123 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory().
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrGlobalDeviceSpace_ |
address at which the global device objects start
Definition at line 112 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory().
char* fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrMuxManagersSpace_ |
Definition at line 100 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory().
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pShmHeader_ |
pointer to ShmHeader structure
Definition at line 82 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory().
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_ |
name of share memory segment
Definition at line 94 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::ShmFactory().
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmSize_ |
size of share memory segment
Definition at line 88 of file ShmFactory.h.
Referenced by fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::createSharedMemory(), fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory(), and fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory().