FIFO.hpp 772 Bytes
Newer Older
1
2
3
#pragma once

#include "ObjectOps.hpp"
Eric Cano's avatar
Eric Cano committed
4
#include "Agent.hpp"
5
#include "exception/Exception.hpp"
6
#include <cxxabi.h>
7

8
9
namespace cta { namespace objectstore {

10
class FIFO: public ObjectOps<serializers::FIFO> {
11
public:
12
13
14
15
  FIFO(const std::string & name, Backend & os):
  ObjectOps<serializers::FIFO>(os, name) {}
 
  void initialize();
16
  
17
18
19
20
21
  class FIFOEmpty: public cta::exception::Exception {
  public:
    FIFOEmpty(const std::string & context): cta::exception::Exception(context) {}
  };
  
22
23
24
  std::string peek(); 

  void pop();
25
  
26
  void push(std::string name);
27
  
28
29
  void pushIfNotPresent (std::string name);
  
30
  std::string dump();
31
  
32
  uint64_t size();
33
  
34
35
  std::list<std::string> getContent();

36
37
private:
  
38
39
  void compact();
  static const size_t c_compactionSize;
40
41
42
};

}}