Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

at_twin.h

Go to the documentation of this file.
00001 //
00002 // The Austria library is copyright (c) Gianni Mariani 2004.
00003 // 
00004 // Grant Of License.  Grants to LICENSEE the non-exclusive right to use the Austria
00005 // library subject to the terms of the LGPL.
00006 // 
00007 // A copy of the license is available in this directory or one may be found at this URL:
00008 //      http://www.gnu.org/copyleft/lesser.txt
00009 // 
00015 #ifndef x_at_twin_h_x
00016 #define x_at_twin_h_x 1
00017 
00018 // Austria namespace
00019 namespace at
00020 {
00021         
00052 //
00053 // forward declaration
00054 //
00055 
00056 template<
00057         typename        w_aide_twin_interface,
00058         typename        w_lead_interface
00059 >
00060 class LeadTwin;
00061 
00062 template<
00063         typename        w_aide_interface
00064 >
00065 class AideTwin;
00066 
00067 
00068 
00069 // ======== TwinTraits ============================================
00075 class TwinTraits
00076 {
00077 
00078         public:
00079 
00085         enum TwinCode
00086         {
00091                 Uninitialized,
00092                 
00098                 CancelRequested,
00099                 
00105                 AideDelete,
00106                 
00112                 AideGrabbed,
00113                 
00119                 AideSetupError
00120                 
00121         };
00122         
00123 };
00124 
00125 
00126 // ======== LeadTwin ===============================================
00136 template<
00137         typename        w_aide_twin_interface,
00138         typename        w_lead_interface
00139 >
00140 class LeadTwin
00141   : public w_lead_interface
00142 {
00143         
00144         friend class AideTwin< typename w_aide_twin_interface::t_aide_interface >;
00145         
00146         public:
00147 
00153         virtual void LeadCancel() = 0;
00154 
00155         protected :
00156 
00163         virtual bool LeadAssociate( w_aide_twin_interface * i_aide ) = 0;
00164 
00171         virtual void LeadCompleted( TwinTraits::TwinCode i_competion_code ) = 0;
00172 
00177         virtual ~LeadTwin() {}
00178 };
00179 
00180 
00181 
00182 // ======== AideTwin ===============================================
00191 template<
00192         typename        w_aide_interface
00193 >
00194 class AideTwin
00195   : public w_aide_interface
00196 {
00197         public:
00198 
00199         virtual void AideCancel() = 0;
00200 
00205         typedef w_aide_interface                        t_aide_interface;
00206 
00207         protected :
00208 
00212         template <typename w_lead >
00213         inline bool WrapLeadAssociate( w_lead * i_lead )
00214         {
00215                 return i_lead->LeadAssociate( this );
00216         }
00217 
00222         template <typename w_lead >
00223         inline void WrapLeadCompleted( w_lead * i_lead, TwinTraits::TwinCode i_competion_code )
00224         {
00225                 i_lead->LeadCompleted( i_competion_code );
00226         }
00227 
00228         ~AideTwin() {}
00229 };
00230 
00231 
00232 }; // namespace
00233 
00234 #endif // x_at_twin_h_x
00235 
00236 

Generated for Austria by doxygen and MakeXS at Sun Oct 24 17:35:34 PDT 2004