ubit
uargsImpl.hpp
1 /************************************************************************
2  *
3  * uargsImpl.cpp : class for creating argument lists ("additive notation").
4  * Ubit GUI Toolkit - Version 6
5  * (C) 2009 | Eric Lecolinet | TELECOM ParisTech | http://www.enst.fr/~elc/ubit
6  *
7  * ***********************************************************************
8  * COPYRIGHT NOTICE :
9  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
10  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
12  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
13  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
14  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
15  * ***********************************************************************/
16 
17 #ifndef _uargsImpl_hpp_
18 #define _uargsImpl_hpp_ 1
19 #include <ubit/unode.hpp>
20 namespace ubit {
21 
22  /* ==================================================== ======== ======= */
23  // implementation of UArgs (should not be used directly by clients).
24 
25  class UArgs;
26  class UArgsImpl;
27  class _UAttrArgs;
28 
29  const UArgsImpl& operator+(const UArgsImpl&, const char*);
30  const UArgsImpl& operator+(const UArgsImpl&, UNode*);
31  const UArgsImpl& operator+(const UArgsImpl&, UNode&);
32  const UArgsImpl& operator+(const UArgsImpl&, const UChild&);
33  const UArgsImpl& operator+(const UArgsImpl&, const UArgs&);
34 
35  const _UAttrArgs& operator,(const _UAttrArgs&, UAttr*);
36  const _UAttrArgs& operator,(const _UAttrArgs&, UAttr&);
37  const _UAttrArgs& operator,(const _UAttrArgs&, UCall*);
38  const _UAttrArgs& operator,(const _UAttrArgs&, UCall&);
39  //const _UAttrArgs& operator,(const _UAttrArgs&, const UAttrChild&);
40 
41  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42 
43  class UArgsImpl {
44  public:
45  UArgsImpl();
46  UArgsImpl(UNode*);
47  UArgsImpl(UNode&);
48  UArgsImpl(const char*);
49  UArgsImpl(const UChild&);
50  UArgsImpl(const UArgs&);
51  UArgsImpl(const UArgsImpl&);
52  ~UArgsImpl();
53 
54  friend const UArgsImpl& operator+(const UArgsImpl&, const char*);
55  friend const UArgsImpl& operator+(const UArgsImpl&, UNode*);
56  friend const UArgsImpl& operator+(const UArgsImpl&, UNode&);
57  friend const UArgsImpl& operator+(const UArgsImpl&, const UChild&);
58  friend const UArgsImpl& operator+(const UArgsImpl&, const UArgs&);
59 
60  friend const UArgsImpl& operator+(const _UAttrArgs&, const UArgsImpl&); // !!!!!
61 
62  private:
63  UArgsImpl& operator=(const UArgsImpl&); // assigment is forbidden
64  friend class UElem;
65  friend class UArgs;
66  class UArgsChildren* children;
67  };
68 
69  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
70 
71  class _UAttrArgs {
72  public:
73  _UAttrArgs();
74  _UAttrArgs(UAttr*);
75  _UAttrArgs(UAttr&);
76  _UAttrArgs(UCall*);
77  _UAttrArgs(UCall&);
78  _UAttrArgs(const UChild&);
79  //_UAttrArgs(const _UAttrArgs&);
80  ~_UAttrArgs();
81 
82  friend const _UAttrArgs& operator,(const _UAttrArgs&, UAttr*);
83  friend const _UAttrArgs& operator,(const _UAttrArgs&, UAttr&);
84  friend const _UAttrArgs& operator,(const _UAttrArgs&, UCall*);
85  friend const _UAttrArgs& operator,(const _UAttrArgs&, UCall&);
86  //friend const _UAttrArgs& operator,(const _UAttrArgs&, const UAttrChild&);
87 
88  friend const UArgsImpl& operator+(const _UAttrArgs&, const UArgsImpl&); // !!!!!
89 
90  private:
91  _UAttrArgs& operator=(const _UAttrArgs&); // assigment is forbidden
92  friend class UElem;
93  friend class UArgs;
94  class UArgsChildren* children;
95  };
96 
97  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
98 
99  class UArgsChildren : public UChildren {
100  friend class UArgs;
101  friend class UArgsImpl;
102  friend class _UAttrArgs;
103  int refcount;
104  //UArgsChildren(); test for counting creation/deletion balance
105  //~UArgsChildren();
106  };
107 
108 }
109 #endif
Base class for attributes.
Definition: uattr.hpp:97
Base class of objects that can be added to the UBIT scene graph (SEE DETAILS!).
Definition: unode.hpp:38
Definition: uargsImpl.hpp:71
lightweight general purpose container.
Definition: uelem.hpp:44
Child (or attribute) list.
Definition: uchild.hpp:79
base class of callback objects for firing functions or methods.
Definition: ucall.hpp:144
Argument list (for passing arguments to constructor or add functions).
Definition: uargs.hpp:43
Definition: uhardfont.hpp:31
Definition: uargsImpl.hpp:43
Definition: uargsImpl.hpp:99
[impl] Internal implementation of a child node.
Definition: uchild.hpp:23