CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ContainerSchema.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_CONTAINERSCHEMA_H
2 #define INCLUDE_ORA_CONTAINERSCHEMA_H
3 
4 #include "MappingTree.h"
5 #include "Sequences.h"
6 // externals
8 
9 namespace coral {
10  class ISchema;
11 }
12 
13 namespace ora {
14 
15  class DatabaseSession;
16  class IBlobStreamingService;
17  class IReferenceHandler;
18 
20  public:
21 
24  const edm::TypeWithDict& containerType,
26 
27  ContainerSchema( int containerId,
28  const std::string& containerName,
29  const std::string& className,
30  DatabaseSession& session );
31 
33 
34  void create();
35 
36  void drop();
37 
38  void evolve();
39 
40  void create( const edm::TypeWithDict& dependentClass );
41 
42  void evolve( const edm::TypeWithDict& dependentClass, MappingTree& baseMapping );
43 
44  void setAccessPermission( const std::string& principal, bool forWrite );
45 
46  const edm::TypeWithDict& type();
47 
48  MappingTree& mapping( bool writeEnabled=false);
49 
50  bool extendIfRequired( const edm::TypeWithDict& dependentClass );
51 
52  MappingElement& mappingForDependentClass( const edm::TypeWithDict& dependentClass, bool writeEnabled=false );
53 
54  bool mappingForDependentClasses( std::vector<MappingElement>& destination );
55 
57 
59 
61 
62  int containerId();
63 
64  const std::string& containerName();
65 
66  const std::string& className();
67 
68  const std::string& mappingVersion();
69 
70  coral::ISchema& storageSchema();
71 
73 
74  private:
75  void initClassDict();
76  bool loadMappingForDependentClass( const edm::TypeWithDict& dependentClass );
77  void extend( const edm::TypeWithDict& dependentClass );
78  void getTableHierarchy( const std::set<std::string>& containerMappingVersions, std::vector<std::string>& destination );
79  private:
80 
86  bool m_loaded;
89  std::map<std::string,MappingTree*> m_dependentMappings;
90 
91  };
92 }
93 
94 #endif
Sequences & containerSequences()
IReferenceHandler * referenceHandler()
void setAccessPermission(const std::string &principal, bool forWrite)
std::map< std::string, MappingTree * > m_dependentMappings
ContainerSchema(int containerId, const std::string &containerName, const edm::TypeWithDict &containerType, DatabaseSession &session)
void getTableHierarchy(const std::set< std::string > &containerMappingVersions, std::vector< std::string > &destination)
bool loadMappingForDependentClass(const edm::TypeWithDict &dependentClass)
Sequences m_containerSchemaSequences
bool mappingForDependentClasses(std::vector< MappingElement > &destination)
const std::string & className()
void extend(const edm::TypeWithDict &dependentClass)
DatabaseSession & m_session
edm::TypeWithDict m_classDict
const edm::TypeWithDict & type()
DatabaseSession & dbSession()
bool extendIfRequired(const edm::TypeWithDict &dependentClass)
Interface for a Streaming Service.
std::string m_containerName
const std::string & containerName()
coral::ISchema & storageSchema()
MappingTree & mapping(bool writeEnabled=false)
session
Definition: models.py:201
const std::string & mappingVersion()
IBlobStreamingService * blobStreamingService()
MappingElement & mappingForDependentClass(const edm::TypeWithDict &dependentClass, bool writeEnabled=false)