fesa-core  4.3.1
fesa::MemoryMappedFileFactory< GlobalDeviceType, DomainStoreType, DevInstType > Class Template Reference

#include <MemoryMappedFileFactory.h>

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

Public Member Functions

 MemoryMappedFileFactory (const std::string &className, const std::string &classVersion)
 generates the shared-memory name (base on device-class name) More...
 
bool setUpMemory ()
 creates the Shared-memory, maps and initializes all the fields More...
 
void createSharedMemory ()
 allocates shared memory-space relying on device data size
 
bool attachSharedMemory ()
 retrieves existing shared memory space and attachs to it.
 
- Public Member Functions inherited from fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >
 DeviceFactoryImp (const std::string &className, const std::string &classVersion)
 Constructor. More...
 
virtual ~DeviceFactoryImp ()
 destructor
 
const std::vector< DevInstType * > & getDeviceCollection () const
 Method retrieves all concrete devices which belong to device factory. More...
 
const std::vector
< DomainStoreType * > & 
getDomainStoreCollection () const
 Method retrieves all concrete domain stores which belong to device factory. More...
 
GlobalDeviceType * getGlobalDevice () const
 Method retrieves global device which belongs to device factory. More...
 
DevInstType * getDevice (const std::string &deviceName) const
 this method retrieves the device instance by its name More...
 
DomainStoreType * getDomainStore (const std::string &domainStoreName) const
 this method retrieves the domain store instance by its name More...
 
void initialize (boost::shared_ptr< ClassElement > &instantiationXMLElementClass)
 this method is responsible for the device data initialization: More...
 

Public Attributes

ShmHeader_t * pShmHeader_
 pointer to ShmHeader structure
 
std::size_t shmSize_
 size of share memory segment
 
std::string shmName_
 name of share memory segment
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >
void computeMemorySize ()
 computes the heap memory size relying on fields size and multiplexing depth in particular. More...
 
void mapFields (char *p, bool initializeFields)
 maps the fields-value object into the heap-memory space More...
 
void unmapFields ()
 unmaps the fields-value object into the heap-memory space
 
void registerPersistenceFields ()
 registers persistent fields in persistency unit needed for persistency mechanism
 
- Protected Attributes inherited from fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >
std::vector< DevInstType * > pDeviceCol_
 vector of devices that belong to device factory
 
std::map< std::string,
DevInstType * > 
deviceNameToDevice_
 
std::vector< DomainStoreType * > pDomainStoreCol_
 vector of domain stores that belong to device factory
 
GlobalDeviceType * pGlobalDevice_
 global device that belong to device factory
 
std::size_t size_
 memory size of complete heap that is used
 
std::size_t globalDeviceSize_
 size of memory for global device
 
std::size_t domainStoreSize_
 size of memory for domain store
 
std::size_t devicesSize_
 size of memory for devices
 
std::size_t muxManagersSize_
 size of memory for multiplexing managers
 
std::string className_
 name of class to which the device factory belongs
 
std::string classVersion_
 version of the class to which the device factory belongs
 

Detailed Description

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

Class responsible for creating and initializing or attaching to the shared memory as a memory mapped file so it can be shared between separate RT and Server processes.

Constructor & Destructor Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::MemoryMappedFileFactory< GlobalDeviceType, DomainStoreType, DevInstType >::MemoryMappedFileFactory ( const std::string &  className,
const std::string &  classVersion 
)

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

Parameters
classNamethe name of the class
classVersionthe version of the device-class

Member Function Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
bool fesa::MemoryMappedFileFactory< GlobalDeviceType, DomainStoreType, DevInstType >::setUpMemory ( )
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 >.


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