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


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.h

    r15 r149  
    3232class SharedMem : public Object {
    3333public:
     34  enum class Type { mutex, producerConsumer };
    3435  /*!
    3536  * \brief Constructor
     
    4041  * \param name name
    4142  * \param size size of the shared memory
     43  * \param blockOnRead if true reading will block if nothing written
    4244  */
    43   SharedMem(const Object *parent, std::string name, size_t size);
     45  SharedMem(const Object *parent, std::string name, size_t size, Type type=Type::mutex);
    4446
    4547  /*!
     
    6567  void Read(char *buf, size_t size) const;
    6668
     69
     70  /*!
     71  * \brief This function should be called when reader starts (in case of a SharedMem of type producerConsumer)
     72  */
     73   void ReaderReady();
    6774private:
    6875  SharedMem_impl *pimpl_;
     76  Type type;
    6977};
    7078
Note: See TracChangeset for help on using the changeset viewer.