RootEntry.hpp 1.36 KB
Newer Older
1
2
3
4
#pragma once

#include "objectstore/cta.pb.h"

5
#include "Backend.hpp"
6
7
#include "ObjectOps.hpp"

8
9
namespace cta { namespace objectstore {

10
11
class Agent;
  
12
class RootEntry: public ObjectOps<serializers::RootEntry> {
13
public:
14
15
  // construtor
  RootEntry(Backend & os);
16
17
18
  
  class NotAllocatedEx: public cta::exception::Exception {
  public:
19
    NotAllocatedEx(const std::string & w): cta::exception::Exception(w) {}
20
21
  };
  
22
23
24
  // In memory initialiser
  void initialize();
  
25
  // Get the name of the agent register (or exception if not available)
26
  std::string getAgentRegister();
27
28
  
  // Get the name of a (possibly freshly created) agent register
29
  std::string allocateOrGetAgentRegister(Agent & agent);
30
31
  
  // Get the name of the JobPool (or exception if not available)
32
  std::string getJobPool();
33
34
  
  // Get the name of a (possibly freshly created) job pool
35
  std::string allocateOrGetJobPool(Agent & agent);
36
  
37
38
39
40
41
42
43
44
45
46
47
48
49
50
private:
  void addIntendedAgentRegistry(const std::string & name);
  
  void deleteFromIntendedAgentRegistry(const std::string & name);
  
  void setAgentRegister(const std::string & name);
  
  void addIntendedJobPool(const std::string & name);
  
  void deleteFromIntendedJobPool(const std::string & name);
  
  void setJobPool(const std::string & name);
  
public:
51
  // Dump the root entry
52
  std::string dump ();
53
54
55
56
57

  private:
    static const std::string s_rootEntryName;
};

58
59
}}

60