RootEntry.hpp 982 Bytes
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: public ObjectOps<serializers::RootEntry> {
12
public:
13
14
  // construtor
  RootEntry(Backend & os);
15
16
17
  
  class NotAllocatedEx: public cta::exception::Exception {
  public:
18
    NotAllocatedEx(const std::string & w): cta::exception::Exception(w) {}
19
20
21
  };
  
  // Get the name of the agent register (or exception if not available)
22
  std::string getAgentRegister();
23
24
  
  // Get the name of a (possibly freshly created) agent register
25
  std::string allocateOrGetAgentRegister(Agent & agent);
26
27
  
  // Get the name of the JobPool (or exception if not available)
28
  std::string getJobPool();
29
30
  
  // Get the name of a (possibly freshly created) job pool
31
  std::string allocateOrGetJobPool(Agent & agent);
32
33
  
  // Dump the root entry
34
  std::string dump ();
35
36
37
38
39

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

40
41
}}

42