Common.h
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#ifndef FAIR_MQ_SHMEM_COMMON_H_
#define FAIR_MQ_SHMEM_COMMON_H_
#include <atomic>
#include <boost/interprocess/managed_shared_memory.hpp>
namespace fair
{
namespace mq
{
namespace shmem
{
struct DeviceCounter
{
DeviceCounter(unsigned int c)
: fCount(c)
{}
std::atomic<unsigned int> fCount;
};
struct RegionCounter
{
RegionCounter(unsigned int c)
: fCount(c)
{}
std::atomic<unsigned int> fCount;
};
struct MonitorStatus
{
MonitorStatus()
: fActive(true)
{}
bool fActive;
};
struct MetaHeader
{
size_t fSize;
size_t fRegionId;
boost::interprocess::managed_shared_memory::handle_t fHandle;
size_t fHint;
};
struct RegionBlock
{
RegionBlock()
: fHandle()
, fSize(0)
, fHint(0)
{}
RegionBlock(boost::interprocess::managed_shared_memory::handle_t handle, size_t size, size_t hint)
: fHandle(handle)
, fSize(size)
, fHint(hint)
{}
boost::interprocess::managed_shared_memory::handle_t fHandle;
size_t fSize;
size_t fHint;
};
} // namespace shmem
} // namespace mq
} // namespace fair
#endif /* FAIR_MQ_SHMEM_COMMON_H_ */
fair::mq::shmem::MonitorStatus
Definition: Common.h:40
fair::mq::shmem::RegionCounter
Definition: Common.h:31
fair::mq::shmem::RegionBlock
Definition: Common.h:57
fair::mq::shmem::DeviceCounter
Definition: Common.h:22
fair
Definition: DeviceRunner.h:23
fair::mq::shmem::MetaHeader
Definition: Common.h:49