MySQL  8.0.17
Source Code Documentation
dd.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef DD__DD_INCLUDED
24 #define DD__DD_INCLUDED
25 
26 namespace dd {
27 
28 ///////////////////////////////////////////////////////////////////////////
29 
30 // enum type to pass to init() function.
31 enum class enum_dd_init_type {
32  DD_INITIALIZE = 1,
36  DD_DELETE,
38 };
39 
40 /**
41  Initialize data dictionary upon server startup, server startup on old
42  data directory or install data dictionary for the first time.
43 
44  @param dd_init - Option for initialization, population or deletion
45  of data dictionary.
46 
47  @return false - On success
48  @return true - On error
49 */
50 bool init(enum_dd_init_type dd_init);
51 
52 /**
53  Shuts down the data dictionary instance by deleting
54  the instance of dd::Dictionary_impl* upon server shutdown.
55 
56  @return false - On success
57  @return true - If invoked when data dictionary instance
58  is not yet initialized.
59 */
60 bool shutdown();
61 
62 /**
63  Get the data dictionary instance.
64 
65  @returns 'Dictionary*' pointer to data dictionary instance.
66  Else returns NULL if data dictionary is not
67  initialized.
68 */
69 class Dictionary *get_dictionary();
70 
71 /**
72  Create a instance of data dictionary object of type X.
73  E.g., X could be 'dd::Table', 'dd::View' and etc.
74 
75  @returns Pointer to the newly allocated dictionary object.
76 */
77 template <typename X>
78 X *create_object();
79 
80 ///////////////////////////////////////////////////////////////////////////
81 
82 } // namespace dd
83 
84 #endif // DD__DD_INCLUDED
bool init(enum_dd_init_type dd_init)
Initialize data dictionary upon server startup, server startup on old data directory or install data ...
Definition: dd.cc:57
enum_dd_init_type
Definition: dd.h:31
bool shutdown()
Shuts down the data dictionary instance by deleting the instance of dd::Dictionary_impl* upon server ...
Definition: dd.cc:70
class Dictionary * get_dictionary()
Get the data dictionary instance.
Definition: dd.cc:75
#define X
Definition: ctype-tis620.cc:75
X * create_object()
Create a instance of data dictionary object of type X.
Definition: dd.cc:78
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:39