Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAddress.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JADDRESS__
2 #define __JLANG__JADDRESS__
3 
4 
5 /**
6  * \author mdejong
7  */
8 
9 namespace JLANG {}
10 namespace JPP { using namespace JLANG; }
11 
12 namespace JLANG {
13 
14 
15  /**
16  * Type definition for constant and non-constant pointers.
17  */
18  template<bool is_const>
20 
21  template<>
22  struct JAddressTypedef<true>
23  {
24  /**
25  * Type definition of address.
26  */
27  typedef const char* pointer_type;
28  };
29 
30  template<>
31  struct JAddressTypedef<false>
32  {
33  /**
34  * Type definition of address.
35  */
36  typedef char* pointer_type;
37  };
38 
39 
40  /**
41  * Simple address wrapper for const and non-const pointers.
42  */
43  template<bool is_const>
44  struct JAddress {
45  /**
46  * Type definition of address.
47  */
49 
50  /**
51  * Constructor.
52  *
53  * \param p pointer to object
54  */
56  address(p)
57  {}
58 
59  protected:
61  };
62 }
63 
64 #endif
Type definition for constant and non-constant pointers.
Definition: JAddress.hh:19
pointer_type address
Definition: JAddress.hh:60
JAddressTypedef< is_const >::pointer_type pointer_type
Type definition of address.
Definition: JAddress.hh:48
char * pointer_type
Type definition of address.
Definition: JAddress.hh:36
Simple address wrapper for const and non-const pointers.
Definition: JAddress.hh:44
JAddress(pointer_type p)
Constructor.
Definition: JAddress.hh:55
const char * pointer_type
Type definition of address.
Definition: JAddress.hh:27