00001 #ifndef OPENTISSUE_DYNAMICS_PSYS_PSYS_CONNECTOR_FACADE_H 00002 #define OPENTISSUE_DYNAMICS_PSYS_PSYS_CONNECTOR_FACADE_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 namespace OpenTissue 00013 { 00014 00015 namespace psys 00016 { 00017 00018 00019 template<typename types> 00020 class ConnectorFacade 00021 { 00022 public: 00023 00024 typedef typename types::system_type system_type; 00025 00026 protected: 00027 00028 system_type * m_owner; 00029 00030 public: 00031 00032 ConnectorFacade() 00033 : m_owner(0) 00034 {} 00035 00036 public: 00037 00044 void connect(system_type const & owner) { m_owner = const_cast<system_type*>(&owner); } 00045 00050 void disconnect() { m_owner = 0; } 00051 00057 system_type * /* const & */ owner() { return m_owner; } 00058 system_type const * /* const & */ owner() const { return m_owner; } 00059 00060 }; 00061 00062 } // namespace psys 00063 00064 } // namespace OpenTissue 00065 00066 // OPENTISSUE_DYNAMICS_PSYS_PSYS_CONNECTOR_FACADE_H 00067 #endif