Nemiver  0.3
nmv-object.h
Go to the documentation of this file.
1 /* -*- Mode: C++; indent-tabs-mode:nil; c-basic-offset:4;-*- */
2 
3 /*Copyright (c) 2005-2006 Dodji Seketeli
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of this
6  * software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute,
9  * sublicense, and/or sell copies of the Software, and to permit
10  * persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies
14  * or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS",
17  * WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18  * INCLUDING BUT NOT LIMITED TO THE
19  * WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE
21  * AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23  * HOLDERS BE LIABLE FOR ANY CLAIM,
24  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25  * CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
27  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  *
29  */
30 #ifndef __NMV_OBJECT_H__
31 #define __NMV_OBJECT_H__
32 
33 #include "nmv-api-macros.h"
34 #include "nmv-namespace.h"
35 #include "nmv-safe-ptr.h"
36 
37 NEMIVER_BEGIN_NAMESPACE (nemiver)
38 NEMIVER_BEGIN_NAMESPACE (common)
39 
40 struct ObjectPriv;
41 class UString;
42 
44  friend struct ObjectPriv;
45 
46 protected:
48 
49 public:
50 
51  Object ();
52 
53  Object (Object const &);
54 
55  Object& operator= (Object const&);
56 
57  virtual ~Object ();
58 
59  void ref ();
60 
61  void unref ();
62 
63  void enable_refcount (bool a_enabled=true);
64 
65  bool is_refcount_enabled () const;
66 
67  long get_refcount () const;
68 
69  void attach_object (const UString &a_key,
70  const Object *a_object);
71 
72  bool get_attached_object (const UString &a_key,
73  const Object *&a_object);
74 
75 };//end class Object
76 
77 NEMIVER_END_NAMESPACE (common)
78 NEMIVER_END_NAMESPACE (nemiver)
79 
80 #endif //__NMV_OBJECT_H__
81 
nemiver::common::Object
Definition: nmv-object.h:43
nemiver
Definition: nmv-address.h:31
nmv-safe-ptr.h
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nmv-api-macros.h
nemiver::common::UString
Definition: nmv-ustring.h:45
nemiver::common::Object::m_priv
SafePtr< ObjectPriv > m_priv
Definition: nmv-object.h:47
nmv-namespace.h
nemiver::common::SafePtr< ObjectPriv >
common
Definition: nmv-proc-list-dialog.h:32