Changeset 149 in flair-src for trunk/lib/FlairCore/src/SharedMem.cpp


Ignore:
Timestamp:
03/01/17 14:36:10 (5 years ago)
Author:
Bayard Gildas
Message:

SharedMem in producerConsumer mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/SharedMem.cpp

    r15 r149  
    2424namespace core {
    2525
    26 SharedMem::SharedMem(const Object *parent, string name, size_t size)
    27     : Object(parent, name, "shmem") {
    28   pimpl_ = new SharedMem_impl(this, name, size);
     26SharedMem::SharedMem(const Object *parent, string name, size_t size, Type type)
     27    : Object(parent, name, "shmem"), type(type) {
     28  pimpl_ = new SharedMem_impl(this, name, size, type);
    2929}
    3030
     
    3535}
    3636
    37 void SharedMem::Read(char *buf, size_t size) const { pimpl_->Read(buf, size); }
     37void SharedMem::Read(char *buf, size_t size) const {
     38  pimpl_->Read(buf, size);
     39}
     40
     41void SharedMem::ReaderReady() {
     42  if (type==Type::producerConsumer) pimpl_->ReaderReady();
     43  else Warn("Function called for a non producerConsumer\n");
     44}
    3845
    3946} // end namespace core
Note: See TracChangeset for help on using the changeset viewer.