23 #include <boost/thread/mutex.hpp>
24 #include <boost/make_shared.hpp>
26 #include <drizzled/identifier.h>
27 #include <drizzled/identifier/catalog.h>
28 #include <drizzled/message/catalog.h>
42 drizzled::session_id_t _lock_id;
43 message::catalog::shared_ptr _message;
44 mutable boost::mutex _schema_lock;
45 mutable boost::mutex _system_variable_lock;
50 typedef boost::shared_ptr<Instance> shared_ptr;
51 typedef std::vector<shared_ptr> vector;
56 Instance(message::catalog::shared_ptr &message_arg) :
57 _identifier(message_arg->name())
59 _message= message_arg;
62 Instance(
const message::catalog::shared_ptr &message_arg) :
63 _identifier(message_arg->name())
65 _message= message_arg;
68 static shared_ptr make_shared(message::catalog::shared_ptr &message_arg)
70 assert(not message_arg->name().empty());
71 return boost::make_shared<Instance>(message_arg);
76 drizzled::message::catalog::shared_ptr new_message= drizzled::message::catalog::make_shared(identifier);
77 assert(not new_message->name().empty());
78 return boost::make_shared<Instance>(new_message);
86 const std::string &getName()
const
89 return _message->name();
92 const std::string &name()
const
95 return _message->name();
98 message::catalog::shared_ptr message()
const
108 bool lock(drizzled::session_id_t
id)
110 if (_locked and _lock_id ==
id)
126 bool unlock(drizzled::session_id_t
id)
128 if (_locked and _lock_id ==
id)
139 boost::mutex &schemaLock()
144 boost::mutex &systemVariableLock()
146 return _system_variable_lock;