ICP  1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
EventStore Class Reference

#include <event_store.h>

Inheritance diagram for EventStore:
Inheritance graph

Classes

struct  EventStoreCardHolder
 
struct  FileEventSourceInfo
 

Public Member Functions

 EventStore ()
 
isisU32_tgetBuffer ()
 
void releaseBuffer (isisU32_t *buffer)
 
uint32_t bufferSize ()
 
 ~EventStore ()
 
void addCards (const std::vector< DAEEventSource * > &det_list)
 
void addCard (DAEEventSource *det_card, bool enable=false)
 
std::list
< boost::signals2::connection > 
addGoodEventCallback (const EventCallbackSlotType &slot)
 
std::list
< boost::signals2::connection > 
addAllEventCallback (const EventCallbackSlotType &slot)
 
std::list
< boost::signals2::connection > 
addGoodFrameCallback (const FrameCallbackSlotType &slot)
 
std::list
< boost::signals2::connection > 
addAllFrameCallback (const FrameCallbackSlotType &slot)
 
std::list
< boost::signals2::connection > 
addNoFrameCallback (const NoFrameCallbackSlotType &slot)
 
void clearCallbacks (const std::list< boost::signals2::connection > &callback_list)
 
void start ()
 
void stop (bool immediate)
 
bool endHeaderSeen ()
 
uint64_t nNewEventWords (DAEstatus &status)
 
void clear ()
 
void setOutputFileName (int run_number, bool new_run, DAEstatus &status)
 
void addFileInputSource (int run_number, FileEventSourceInfo &info)
 
void addRawFileInputSource (ISISRAW *iraw, int source_id, time_t run_start)
 
void setCardStatus (int id, bool enable)
 
void setCardStatus (bool enable)
 
uint64_t numRawEvents ()
 
uint64_t numGoodEvents ()
 
void getEventSourceIDs (std::vector< int > &ids)
 
void getEnabledEventSourceIDs (std::vector< int > &ids)
 
void closeOutputFile (DAEstatus &status)
 
void closeAndDeleteOutputFile (int run_number, DAEstatus &status)
 

Static Public Member Functions

static const Poco::Path & baseDir ()
 
static Poco::Path baseRunDir (int run_number)
 
static void deleteOutputFile (int run_number, DAEstatus &status)
 
static int maxNumCallbackEvents ()
 

Private Member Functions

template<typename SLOT >
std::list
< boost::signals2::connection > 
addCallback (boost::signals2::connection(EventStoreCard::*func)(const SLOT &), const SLOT &slot)
 
void clearAllCallbacks ()
 
void clearSources ()
 
void clearStores ()
 
void findUnusedFileInputSources (int run_number, std::set< std::string > &files)
 
void invokeNoFrameCallbacks (NoFrameCallbackMode mode)
 
void clearOutputFile (DAEstatus &status)
 

Static Private Member Functions

static void findFileInputSources (int run_number, std::set< std::string > &files)
 
static int eventSourceIDFromFileInputSource (const std::string &file)
 

Private Attributes

Poco::MemoryPool m_mempool
 
Poco::ThreadPool m_threads
 
std::vector
< FileEventSourceBase * > 
m_sources
 
std::vector< EventStoreCardHolderm_stores
 
std::list
< boost::signals2::connection > 
m_callbacks
 

Static Private Attributes

static const int m_mempool_size = 32 * 1024 * 1024
 
static Poco::Path m_base_dir
 

Additional Inherited Members

- Protected Member Functions inherited from ISIS::Base
 Base (const std::string &logger_name="UNKNOWN")
 
void setLoggerName (const std::string &logger_name)
 
virtual ~Base ()
 
virtual std::string loggingPrefix () const
 
void setThisLoggerLevel (int level)
 
- Static Protected Member Functions inherited from ISIS::Base
static void setAllLoggerLevel (int level)
 
- Protected Attributes inherited from ISIS::Base
Poco::Logger * m_logger
 
Poco::LogStream * m_logstr
 
Poco::Mutex m_logger_lock
 

Detailed Description

Definition at line 27 of file event_store.h.

Constructor & Destructor Documentation

EventStore::EventStore ( )

Definition at line 7 of file event_store.cpp.

References LOGSTR_DEBUG, m_threads, and ISIS::Base::setLoggerName().

EventStore::~EventStore ( )

Definition at line 356 of file event_store.cpp.

References clear(), LOGSTR_DEBUG, and stop().

Member Function Documentation

std::list< boost::signals2::connection > EventStore::addAllEventCallback ( const EventCallbackSlotType slot)
std::list< boost::signals2::connection > EventStore::addAllFrameCallback ( const FrameCallbackSlotType slot)
template<typename SLOT >
std::list< boost::signals2::connection > EventStore::addCallback ( boost::signals2::connection(EventStoreCard::*)(const SLOT &)  func,
const SLOT &  slot 
)
private
void EventStore::addCard ( DAEEventSource det_card,
bool  enable = false 
)
void EventStore::addCards ( const std::vector< DAEEventSource * > &  det_list)

Definition at line 158 of file event_store.cpp.

References addCard(), and LOGSTR_DEBUG.

void EventStore::addFileInputSource ( int  run_number,
FileEventSourceInfo info 
)
std::list< boost::signals2::connection > EventStore::addGoodEventCallback ( const EventCallbackSlotType slot)
std::list< boost::signals2::connection > EventStore::addGoodFrameCallback ( const FrameCallbackSlotType slot)
std::list< boost::signals2::connection > EventStore::addNoFrameCallback ( const NoFrameCallbackSlotType slot)
void EventStore::addRawFileInputSource ( ISISRAW iraw,
int  source_id,
time_t  run_start 
)

Definition at line 143 of file event_store.cpp.

References addCard(), LOGSTR_DEBUG, and m_sources.

Referenced by EventsToolApp::convertRawToEvents().

static const Poco::Path& EventStore::baseDir ( )
inlinestatic
static Poco::Path EventStore::baseRunDir ( int  run_number)
inlinestatic

Definition at line 118 of file event_store.h.

References baseDir().

Referenced by deleteOutputFile().

uint32_t EventStore::bufferSize ( )
inline

Definition at line 82 of file event_store.h.

References m_mempool_size.

Referenced by EventStoreCard::run().

void EventStore::clear ( )
void EventStore::clearAllCallbacks ( )
inlineprivate

Definition at line 49 of file event_store.h.

References m_callbacks.

Referenced by clear().

void EventStore::clearCallbacks ( const std::list< boost::signals2::connection > &  callback_list)
inline

Definition at line 91 of file event_store.h.

Referenced by ISISDAE::clearCallbacks(), and TCPEventStreamConnection::run().

void EventStore::clearOutputFile ( DAEstatus status)
private
void EventStore::clearSources ( )
private

Definition at line 370 of file event_store.cpp.

References m_sources.

Referenced by clear().

void EventStore::clearStores ( )
private

Definition at line 379 of file event_store.cpp.

References EventStore::EventStoreCardHolder::card, and m_stores.

Referenced by clear().

void EventStore::closeAndDeleteOutputFile ( int  run_number,
DAEstatus status 
)

Definition at line 238 of file event_store.cpp.

References closeOutputFile(), deleteOutputFile(), and stop().

Referenced by ISISDAE::clearCounters(), and ISISDAE::startRun().

void EventStore::closeOutputFile ( DAEstatus status)
void EventStore::deleteOutputFile ( int  run_number,
DAEstatus status 
)
static
bool EventStore::endHeaderSeen ( )
int EventStore::eventSourceIDFromFileInputSource ( const std::string &  file)
staticprivate

Definition at line 85 of file event_store.cpp.

Referenced by addFileInputSource().

void EventStore::findFileInputSources ( int  run_number,
std::set< std::string > &  files 
)
staticprivate

Definition at line 65 of file event_store.cpp.

References baseDir().

Referenced by addFileInputSource(), deleteOutputFile(), and findUnusedFileInputSources().

void EventStore::findUnusedFileInputSources ( int  run_number,
std::set< std::string > &  files 
)
private
isisU32_t * EventStore::getBuffer ( )

Definition at line 391 of file event_store.cpp.

References m_mempool.

Referenced by EventStoreCard::run().

void EventStore::getEnabledEventSourceIDs ( std::vector< int > &  ids)
void EventStore::getEventSourceIDs ( std::vector< int > &  ids)
void EventStore::invokeNoFrameCallbacks ( NoFrameCallbackMode  mode)
private
static int EventStore::maxNumCallbackEvents ( )
inlinestatic

Definition at line 128 of file event_store.h.

References m_mempool_size.

uint64_t EventStore::nNewEventWords ( DAEstatus status)
uint64_t EventStore::numGoodEvents ( )
uint64_t EventStore::numRawEvents ( )
void EventStore::releaseBuffer ( isisU32_t buffer)

Definition at line 396 of file event_store.cpp.

References m_mempool.

Referenced by EventStoreCard::run().

void EventStore::setCardStatus ( int  id,
bool  enable 
)
void EventStore::setCardStatus ( bool  enable)
void EventStore::setOutputFileName ( int  run_number,
bool  new_run,
DAEstatus status 
)
void EventStore::start ( )
void EventStore::stop ( bool  immediate)

Member Data Documentation

Poco::Path EventStore::m_base_dir
staticprivate

Definition at line 43 of file event_store.h.

Referenced by baseDir().

std::list<boost::signals2::connection> EventStore::m_callbacks
private

Definition at line 44 of file event_store.h.

Referenced by clearAllCallbacks().

Poco::MemoryPool EventStore::m_mempool
private

Definition at line 31 of file event_store.h.

Referenced by getBuffer(), and releaseBuffer().

const int EventStore::m_mempool_size = 32 * 1024 * 1024
staticprivate

Definition at line 30 of file event_store.h.

Referenced by bufferSize(), and maxNumCallbackEvents().

std::vector<FileEventSourceBase*> EventStore::m_sources
private

Definition at line 33 of file event_store.h.

Referenced by addFileInputSource(), addRawFileInputSource(), and clearSources().

std::vector<EventStoreCardHolder> EventStore::m_stores
private
Poco::ThreadPool EventStore::m_threads
private

Definition at line 32 of file event_store.h.

Referenced by EventStore(), start(), and stop().


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