00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef _uargs_hpp_
00020 #define _uargs_hpp_
00021 
00022 #include <ubit/ubrick.hpp>
00023 namespace ubit {
00024 
00025 class UArgsImpl;
00026 
00027 class UArgsList : public UChildren {
00028   friend class UArgs;
00029   friend class UArgsImpl;
00030   int refcount;
00031 };
00032 
00033 
00039 class UArgs {
00040 public:
00041   static const UArgs none;
00042 
00043   UArgs();
00044   ~UArgs();
00045   UArgs(const UArgs&);
00046   UArgs(const UArgsImpl&);
00047   UArgs(const char*);
00048   UArgs(UBrick*);
00049   UArgs(UBrick&);
00050   UArgs(const UChild&);
00051 
00052   UArgs& operator+=(const UArgs&);
00053   friend const UArgsImpl& operator+(const UArgsImpl&, const char*);
00054   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick*);
00055   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick&);
00056   friend const UArgsImpl& operator+(const UArgsImpl&, const UChild&);
00057   friend const UArgsImpl& operator+(const UArgsImpl&, const UArgs&);
00058 
00059 
00060   UArgsList* children;
00061 private:
00062   friend class UGroup;
00063   friend class UBox;
00064   friend class UArgsImpl;
00065   UArgs& operator=(const UArgs&);  
00066 };
00067 
00068 
00069 
00070 
00071 class UArgsImpl {
00072 public:
00073   UArgsImpl();
00074   ~UArgsImpl();
00075   UArgsImpl(const UArgsImpl&);
00076   UArgsImpl(const UArgs&);
00077   UArgsImpl(const char*);
00078   UArgsImpl(UBrick*);
00079   UArgsImpl(UBrick&);
00080   UArgsImpl(const UChild&);
00081   
00082   friend const UArgsImpl& operator+(const UArgsImpl&, const char*);
00083   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick*);
00084   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick&);
00085   friend const UArgsImpl& operator+(const UArgsImpl&, const UChild&);
00086   friend const UArgsImpl& operator+(const UArgsImpl&, const UArgs&);
00087 
00088 private:
00089   friend class UGroup;
00090   friend class UBox;
00091   friend class UArgs;
00092   UArgsImpl& operator=(const UArgsImpl&);  
00093   UArgsList* children;
00094 };
00095 
00096 }
00097 #endif
00098 
00099