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

#include "objectstore/cta.pb.h"

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

9
10
namespace cta { namespace objectstore {

11
class RootEntry: private ObjectOps<serializers::RootEntry> {
12
13
public:
  // Initializer.
14
  static void init(Backend & os);
15
  
16
17
  // construtor, when the backend store exists.
  // Checks the existence and correctness of the root entry
18
  RootEntry(Agent & agent);
19
20
21
  
  class NotAllocatedEx: public cta::exception::Exception {
  public:
22
    NotAllocatedEx(const std::string & w): cta::exception::Exception(w) {}
23
24
25
  };
  
  // Get the name of the agent register (or exception if not available)
26
  std::string getAgentRegister(Agent & agent);
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(Agent & agent);
33
34
  
  // Get the name of a (possibly freshly created) job pool
35
  std::string allocateOrGetJobPool(Agent & agent);
36
37
  
  // Dump the root entry
38
  std::string dump (Agent & agent);
39
40
41
42
43

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

44
45
}}

46