A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CatalogUserTypeMetadata.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * Copyright 2018 Rice University *
4  * *
5  * Licensed under the Apache License, Version 2.0 (the "License"); *
6  * you may not use this file except in compliance with the License. *
7  * You may obtain a copy of the License at *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14  * See the License for the specific language governing permissions and *
15  * limitations under the License. *
16  * *
17  *****************************************************************************/
18 /*
19  * CatalogUserTypeMetadata.h
20  *
21  */
22 
23 #ifndef CATALOG_USER_TYPE_METADATA_H_
24 #define CATALOG_USER_TYPE_METADATA_H_
25 
26 #include <algorithm>
27 #include <iostream>
28 #include <string>
29 #include <vector>
30 #include "PDBString.h"
31 
32 // PRELOAD %CatalogUserTypeMetadata%
33 
34 using namespace std;
35 
36 namespace pdb {
37 
48 
49 public:
51 
53 
55  pdb::String objectIDIn,
56  pdb::String objectTypeIn,
57  pdb::String objectNameIn,
58  pdb::String libraryBytesIn)
59  : itemId(itemIdIn),
60  objectID(objectIDIn),
61  objectType(objectTypeIn),
62  objectName(objectNameIn),
63  libraryBytes(libraryBytesIn) {}
64 
65  CatalogUserTypeMetadata(const CatalogUserTypeMetadata& pdbCatalogEntryToCopy) {
66  itemId = pdbCatalogEntryToCopy.itemId;
67  objectID = pdbCatalogEntryToCopy.objectID;
68  objectType = pdbCatalogEntryToCopy.objectType;
69  objectName = pdbCatalogEntryToCopy.objectName;
70  libraryBytes = pdbCatalogEntryToCopy.libraryBytes;
71  }
72 
74  itemId = pdbCatalogEntryToCopy->itemId;
75  objectID = pdbCatalogEntryToCopy->objectID;
76  objectType = pdbCatalogEntryToCopy->objectType;
77  objectName = pdbCatalogEntryToCopy->objectName;
78  libraryBytes = pdbCatalogEntryToCopy->libraryBytes;
79  }
80 
82 
84  return objectName;
85  }
86 
88  return itemId;
89  }
90 
92  return objectID;
93  }
94 
96  return objectType;
97  }
98 
100  return objectName;
101  }
102 
104  return libraryBytes;
105  }
106 
107  void setObjectId(pdb::String& objectIdIn) {
108  objectID = objectIdIn;
109  }
110 
111  void setItemId(pdb::String& itemIdIn) {
112  itemId = itemIdIn;
113  }
114 
115  void setItemKey(pdb::String& itemKeyIn) {
116  objectName = itemKeyIn;
117  }
118 
119  void setItemName(pdb::String& itemIdIn) {
120  objectName = itemIdIn;
121  }
122 
123  void setLibraryBytes(pdb::String& bytesIn) {
124  libraryBytes = bytesIn;
125  }
126 
127  void setLibraryBytes(std::string bytesIn) {
128  libraryBytes = bytesIn;
129  }
130 
131  string printShort() {
132  string output;
133  output = " Type ID: ";
134  output.append(getObjectID().c_str()).append(" | Type Name: ").append(getItemName().c_str());
135  return output;
136  }
137 
138  friend std::ostream& operator<<(std::ostream& out, CatalogUserTypeMetadata& userDefinedObject) {
139  out << "\nCatalog User-defined Type Metadata" << endl;
140  out << "-------------------" << endl;
141  out << " Type Id: " << userDefinedObject.getObjectID().c_str() << endl;
142  out << " Type Key: " << userDefinedObject.getItemKey().c_str() << endl;
143  out << " Type Name: " << userDefinedObject.getItemName().c_str() << endl;
144  out << "-------------------\n" << endl;
145  return out;
146  }
147 
148 private:
149  // numeric index to indicate the position on the vector
151  // numeric unique ID for a user-defined object starts from 8192
153  // object type, e.g. data_type, metric
155  // the name of the user-defined object
157  // the bytes containing the .so library file
159 };
160 
161 } /* namespace pdb */
162 
163 #endif /* CATALOG_USER_TYPE_METADATA_H_ */
#define ENABLE_DEEP_COPY
Definition: DeepCopy.h:52
void setLibraryBytes(pdb::String &bytesIn)
void setObjectId(pdb::String &objectIdIn)
void setLibraryBytes(std::string bytesIn)
friend std::ostream & operator<<(std::ostream &out, CatalogUserTypeMetadata &userDefinedObject)
void setItemName(pdb::String &itemIdIn)
CatalogUserTypeMetadata(const Handle< CatalogUserTypeMetadata > &pdbCatalogEntryToCopy)
void setItemId(pdb::String &itemIdIn)
CatalogUserTypeMetadata(const CatalogUserTypeMetadata &pdbCatalogEntryToCopy)
ENABLE_DEEP_COPY CatalogUserTypeMetadata()
char * c_str() const
Definition: PDBString.cc:184
void setItemKey(pdb::String &itemKeyIn)
CatalogUserTypeMetadata(pdb::String itemIdIn, pdb::String objectIDIn, pdb::String objectTypeIn, pdb::String objectNameIn, pdb::String libraryBytesIn)