Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

hyp.fem.intern.h

Go to the documentation of this file.
00001 /*
00002 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00003  Ephydryne Components.
00004  Ephydryne is a part of the Hyperion Project.
00005 ----------------------------------------------------------
00006  Copyright (c) 2001 Pierre Rebours.
00007 
00008  This library is free software; you can redistribute it and/or
00009  modify it under the terms of the GNU Lesser General Public
00010  License as published by the Free Software Foundation; either
00011  version 2.1 of the License, or (at your option) any later version.
00012 
00013  This library is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  
00017  See hyp.license.txt file for more information about the license.
00018  
00019  Web: http://lagrandeporte.multimania.com/hyperion
00020  Email: pierre_rebours@yahoo.com
00021 ----------------------------------------------------------
00022  CVS
00023  $Log$
00024 
00025  Creation 26/03/01 Pierre Rebours
00026 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00027 */
00028 
00029 
00030 
00031 #ifndef _hyp_fem_intern_h_
00032 #define _hyp_fem_intern_h_
00033 
00038 
00042 #define hypfem_INSIDE_INTERN
00043 
00044 #define hyp_CATCH_ITOR  catch(hyp_ker::CComError error) {                               \
00045                                                         if(hyp_ker::hyp_FAILED(error.GetError())) {     \
00046                                                                 throw error;                                                    \
00047                                                         }                                                                                       \
00048                                                 }
00049 
00050 
00051 
00052 #include"hyp.fem.extern.h"
00053 
00055 #define hypfem_USE_GLOBAL_FACTORY
00056 #define hypfem_TRACE_ON
00057 #define hypfem_TRACE_DESTRUCTOR_ON
00058 #define hypfem_IDENTIFY_CONSTRUCTION_ON
00059 
00060 #ifdef hypfem_TRACE_ON
00061 #define hypfem_TRACE( args )                                            \
00062                 hyp_TRACE_BEGIN;                                                        \
00063                 hyp_TRACE_DO( ("Trace from fem server") );      \
00064                 hyp_TRACE_DO( args );                                           \
00065                 hyp_TRACE_END;
00066 #else
00067 #define hypfem_TRACE( args )
00068 #endif
00069 
00070 #ifdef hypfem_TRACE_DESTRUCTOR_ON
00071 #define hypfem_TRACE_DESTRUCTOR( args ) hypfem_TRACE( args )
00072 #endif
00073 
00074 #ifdef hypfem_IDENTIFY_CONSTRUCTION_ON
00075 class CIDClass {
00076 protected:
00077         CIDClass() {
00078                 hyp_ker::CTime _t;
00079                 _t.SetCurrent();
00080                 std::stringstream str_stream;
00081                 str_stream<<_t;
00082                 m_ID=str_stream.str();
00083                 ms_NbGlobalInstances++;
00084         }
00085         virtual ~CIDClass() {
00086                 ms_NbGlobalInstances--;
00087                 if(ms_NbGlobalInstances==0) hyp_ker::clog<<"!!!No Memory Leak!!!";
00088         }
00089         std::string m_ID;
00090         static int ms_NbGlobalInstances;
00091 public:
00092         static int GetNbGlobalInstances(void) { return ms_NbGlobalInstances; }
00093 };
00094 #define hypfem_TRACE_CONSTRUCTION( args )       \
00095         hyp_TRACE_BEGIN;                                                \
00096         hyp_TRACE_DO( args );                                   \
00097 { std::stringstream _stream;_stream<<"-"<<this;m_ID+=_stream.str();     }\
00098         hyp_TRACE_DO( ("Creation %s",m_ID.c_str()) );   \
00099         hyp_TRACE_END;                                                  
00100 #else
00101 #define hypfem_TRACE_CONSTRUCTION( args )
00102 #endif
00103 
00105 
00106 
00107 #include"extern_library/newmat.h"
00108 
00109 
00110 hyp_NAMESPACE_BEGIN_HYPFEM
00111 
00112 //DOXYTAG
00113 #ifndef hypfem_DOXYGEN
00114 
00115 namespace common {
00116 #include"hyp.com.container.h"
00117 #include"hyp.com.factorieslibrary.h"
00118 }
00119 
00120 namespace math {
00121 typedef NEWMAT::Matrix t_LibraryMatrix;
00122 typedef NEWMAT::ColumnVector t_LibraryVector;
00123 #include"hyp.math.matrix.h"
00124 #include"hyp.math.vector.h"
00125 }
00126 
00127 namespace data {
00128 #include"hyp.data.vertex.h"
00129 #include"hyp.data.base.h"
00130 #include"hyp.data.side.h"
00131 #include"hyp.data.object.h"
00132 }
00133 
00134 namespace fem {
00135 #include"hyp.fem.node.h"
00136 #include"hyp.fem.element.h"
00137 #include"hyp.fem.mesh.h"
00138 #include"hyp.fem.materials.h"
00139 }
00140 
00141 #endif
00142 
00143 class CGlobalFactory
00144 {
00145         CGlobalFactory();
00146         static IFactoriesLibrary* m_Inst;
00147 
00148 public:
00149         static IFactoriesLibrary* Inst(void) {
00150                 if(m_Inst==0) {
00151                         hyp_ker::CreateInstance(CLSID_hypCFactoriesLibrary,0,
00152                                 hyp_ker::INPROC_SERVER,
00153                                 IID_hypIFactoriesLibrary,
00154                                 (void**)&m_Inst);
00155                 }
00156                 return m_Inst;
00157         }
00158         static bool IsInit(void) { return m_Inst ? true:false; }
00159 
00160         static void CreateInstance(const hyp_ker::hypCLSID& clsid,hyp_ker::IUnknown* pI,const hyp_ker::hypIID& iid,void** ppv) 
00161         {
00162 #ifdef hypfem_USE_GLOBAL_FACTORY
00163                 Inst()->CreateInstance(clsid,pI,hyp_ker::INPROC_SERVER,iid,ppv);
00164 #else
00165                 hyp_ker::hypCreateInstance(clsid,pI,hyp_ker::INPROC_SERVER,iid,ppv);
00166 #endif
00167         }
00168 
00169 };
00170 
00171 hyp_NAMESPACE_END_HYPFEM
00172 
00173 
00174 #endif  

Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.