fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType > Class Template Reference

This class is responsible for create and initialize the data memory space into shared-memory space:

More...

#include <ShmFactory.h>

Inheritance diagram for fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >:
fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >

List of all members.

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_tpShmHeader_
 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")

Detailed Description

template<typename GlobalDeviceType, typename DomainStoreType, typename DevInstType>
class fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >

This class is responsible for create and initialize the data memory space into shared-memory space:

Definition at line 46 of file ShmFactory.h.


Constructor & Destructor Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::ShmFactory ( const std::string &  className  )  [inline]

generates the shared-memory name (base on device-class name)

Parameters:
className the name of the class

Definition at line 135 of file ShmFactory.h.

References fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_.


Member Function Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
bool fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::attachSharedMemory ( int32_t  fd  )  [inline]

retrieves existing shared memory space and attachs to it.

Parameters:
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().

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
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().

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
void fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::removeSharedMemory (  )  [inline]
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
bool fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory (  )  [inline, virtual]

creates the Shared-memory, maps and initializes all the fields

Returns:
true: shared-memory has been created
false: shared-memory already exist, has been attached only

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().


Member Data Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
CMW::Log::Logger & fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::logger_ = CMW::Log::LoggerFactory::getLogger("FESA.FWK.fesa-core.DataStore.ShmFactory") [inline, static, private]
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDeviceInstanceSpace_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
char* fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrDomainStoreSpace_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
char* fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrEquipmentDataSpace_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrGlobalDeviceSpace_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
char* fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pAddrMuxManagersSpace_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::pShmHeader_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmName_
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::ShmFactory< GlobalDeviceType, DomainStoreType, DevInstType >::shmSize_

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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1