libutil++  1.9.3
 All Classes Functions Variables
UUID.h
1 /*
2 ** libutil++
3 ** $Id: UUID.h 1702 2016-08-13 23:26:06Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 #ifndef __libutilxx__sella__variant__UUID_H__
10 #define __libutilxx__sella__variant__UUID_H__
11 
12 #include "../../common.h"
13 #include "TypeCastException.h"
14 #include "Nullable.h"
15 #include "../util/UUID.h"
16 
17 #include <memory>
18 
19 #include <boost/regex.hpp>
20 
21 namespace sella {
22  namespace variant {
23  class UUID;
24  }
25 }
26 
28  public:
29  static const boost::regex & Pattern(void) { static boost::regex regex("^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$", boost::regex::icase); return regex; }
30  static const int Type = 0x07;
31 
32  /* Constructors */
33  UUID() throw ();
34  UUID(const std::string &value) throw (TypeCastException);
35  UUID(std::string &&value) throw (TypeCastException);
36  UUID(const char *value) throw (TypeCastException);
37  UUID(uuid_t &value) throw ();
38  UUID(const sella::util::UUID &value) throw ();
39  UUID(sella::util::UUID &&value) throw ();
40 
41  UUID(const UUID &other) throw ();
42  UUID(UUID &&other) throw ();
43  virtual ~UUID() throw ();
44 
45  /* Operators */
46  bool operator==(const UUID &other) const throw ();
47  bool operator!=(const UUID &other) const throw ();
48  bool operator>(const UUID &other) const throw ();
49  bool operator<(const UUID &other) const throw ();
50  UUID& operator=(const UUID &other) throw ();
51  UUID& operator=(const sella::util::UUID &other) throw ();
52 
53  /* Public Member Functions */
54  const sella::util::UUID& get() const throw ();
55  sella::util::UUID& get() throw ();
56 
57  void clear() throw();
58 
59  virtual void shrink_to_fit() throw ();
60  virtual void msgpack(sella::util::MessagePack &mpack, uint32_t &offset) const throw (TypeCastException);
61  virtual void msgpackBufferSize(size_t &size) const throw ();
62  virtual std::string str(int type) const throw ();
63  virtual int getType(void) throw () { return Type; }
64 
65  static bool isType(const std::string &value) throw () { return isType(value.c_str(), value.size()); }
66  static bool isType(const char *value, size_t size) throw ();
67 };
68 
69 #endif
70 
71 /*
72 ** vim: noet ts=3 sw=3
73 */