CUBRID Engine  latest
class_description.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
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 /*
20  * class_description.hpp
21  */
22 
23 #ifndef _CLASS_DESCRIPTION_HPP_
24 #define _CLASS_DESCRIPTION_HPP_
25 
26 #if defined(SERVER_MODE)
27 #error Does not belong to server module
28 #endif //defined(SERVER_MODE)
29 
30 #include <vector>
31 
32 struct db_object;
33 struct sm_class;
34 class string_buffer;
35 struct tr_triglist;
36 
37 /*
38  * CLASS_HELP
39  *
40  * Note :
41  * This structure contains information about a class defined in the database.
42  * This will be built and returned by help_class or help_class_name.
43  */
44 //all members should be refactored but for the moment is only triggers and partition are...
46 {
47  enum type
48  {
49  /*OBJ_PRINT_*/ CSQL_SCHEMA_COMMAND,
50  /*OBJ_PRINT_*/ SHOW_CREATE_TABLE
51  };
52 
53  char *name;
54  char *class_type;
55  char *collation;
56  char **supers;
57  char **subs;
58  char **attributes;
60  char **methods;
61  char **class_methods;
62  char **resolutions;
63  char **method_files;
64  char **query_spec;
65  char *object_id;
66  std::vector<char *> triggers;
67  char **constraints;
68  std::vector<char *> partition;
69  char *comment;
70 
71  class_description (); //former obj_print_make_class_help()
72  ~class_description (); //former obj_print_help_free_class()
73 
74  int init (const char *name); //former obj_print_help_class()
75  int init (struct db_object *op, type prt_type);
76  int init (struct db_object *op, type prt_type, string_buffer &sb);//to be used in object_printer::describe_class()
77 
78  //ToDo: other special methods: copy&move ctor/assign
79 };
80 
81 #endif // _CLASS_DESCRIPTION_HPP_
std::vector< char * > partition
int init(const char *name)
std::vector< char * > triggers