RootEntry.hpp 1.31 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
  };
  
  // Get the name of the agent register (or exception if not available)
23
  std::string getAgentRegister();
24
25
  
  // Get the name of a (possibly freshly created) agent register
26
  std::string allocateOrGetAgentRegister(Agent & agent);
27
28
  
  // Get the name of the JobPool (or exception if not available)
29
  std::string getJobPool();
30
31
  
  // Get the name of a (possibly freshly created) job pool
32
  std::string allocateOrGetJobPool(Agent & agent);
33
  
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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:
48
  // Dump the root entry
49
  std::string dump ();
50
51
52
53
54

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

55
56
}}

57