Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

sbacklnk.hpp

Go to the documentation of this file.
00001 // +-------------------------------------------------------------------------+
00002 // |               I__n__t__e__L__i__b           0.6.10 development          |
00003 // | Copyright (c) Andrey Vikt. Stolyarov <crocodil_AT_croco.net> 2000-2007. |
00004 // |                                                                         |
00005 // | This is free software. The library part is available under              |
00006 // |                               GNU LESSER GENERAL PUBLIC LICENSE v.2.1.  |
00007 // | GNU LGPL v2.1 is found in docs/gnu_gpl2.txt,  or at  http://www.gnu.org |
00008 // |     Please see also docs/readme.txt and visit http://www.intelib.org    |
00009 // |                                                                         |
00010 // | !!! THERE IS NO WARRANTY OF ANY KIND, NEITHER EXPRESSED NOR IMPLIED !!! |
00011 // +-------------------------------------------------------------------------+
00012 
00013 
00014 
00015 
00022 #ifndef INTELIB_SBACKLNK_HPP_SENTRY
00023 #define INTELIB_SBACKLNK_HPP_SENTRY
00024 
00025 #include "sexpress.hpp"
00026 #include "iexcept.hpp"
00027 
00028 class SBacklinkRef;
00029 
00031 
00043 class SExpressionBacklink : public SExpressionCons {
00044     SExpressionBacklink* back;
00045 public:
00047     static IntelibTypeId TypeId;
00048 
00050 
00051     SExpressionBacklink(const SReference &acar,
00052                         const SReference &acdr)
00053            : SExpressionCons(acar, acdr, TypeId), back(0) {}
00054 protected:
00055     SExpressionBacklink(const SReference &acar,
00056                         const SReference &acdr, 
00057                         const IntelibTypeId &t)
00058            : SExpressionCons(acar, acdr, t), back(0) {}
00059     ~SExpressionBacklink(); 
00060 
00061 public:
00063     virtual SExpression* Clone() const;
00064 
00065     // TextRepresentation is just the same as for SExpressionCons
00066 
00068 
00074     bool ConnectBack(const SBacklinkRef &where_to);
00076 
00080     bool DisconnectBack();
00081 
00083     void InsertAfter(const SReference &ref);
00085     bool RemoveNext();
00086 
00088     class SBacklinkRef Prev() const;
00090     class SBacklinkRef Next() const;
00091 };
00092 
00094 
00097 class SBacklinkRef : public SReference {
00098 public:
00100     SBacklinkRef();
00102     SBacklinkRef(SExpressionBacklink *ex);
00104     SBacklinkRef(const SReference &ref);
00106     SBacklinkRef(const SBacklinkRef &other);
00108     ~SBacklinkRef();
00109 
00111     SBacklinkRef& operator=(SExpressionBacklink *ex)
00112         { this->SReference::operator=(ex); return *this; }
00114     SBacklinkRef& operator=(const SBacklinkRef &other)
00115         { this->SReference::operator=(other); return *this; }
00117     SBacklinkRef& operator=(const SReference &ref);
00118 
00119 
00121 
00124     void InsertAfter(const SReference &ref);
00125 
00127 
00133     bool Remove();
00134 
00136 
00142     SExpressionBacklink *GetPtr() const;
00143 
00145     SExpressionBacklink *operator->() const { return GetPtr(); }
00146 
00148     SBacklinkRef operator,(const SReference &s);
00149 
00151     SBacklinkRef Begin() const;
00153     SBacklinkRef End() const;
00154     
00156     SBacklinkRef& operator++();
00158     SBacklinkRef& operator--();
00160     SBacklinkRef operator++(int);
00162     SBacklinkRef operator--(int);
00163 };
00164 
00165 
00167 class IntelibX_not_a_backlink : public IntelibX {
00168 public:
00169     IntelibX_not_a_backlink(SReference a_param);
00170 };
00171 
00172 #endif

Generated on Tue Dec 18 00:39:44 2007 for InteLib by  doxygen 1.4.1