Diana  0.8.3
CapeBasic.hpp
00001 /* -----------------------------------------------------------------------------
00002  *  Diana process modelling, simulation and analysis software
00003  *  Copyright (c) 2005, Michael Krasnyk
00004  *  All rights reserved.
00005  *
00006  *  This file is a part of Diana process modelling, simulation and analysis software
00007  *
00008  *  Diana is free software; you can redistribute it and/or modify it
00009  *  under the terms of the GNU General Public License as published
00010  *  by the Free Software Foundation (see accompanying file LICENSE)
00011  * -----------------------------------------------------------------------------
00012  *  $Id: CapeBasic.hpp 8160 2009-03-16 18:36:30Z miha $
00013  * -----------------------------------------------------------------------------
00014  *  Description:
00015  */
00016 
00017 #ifndef CAPE_BASIC_HPP
00018 #define CAPE_BASIC_HPP
00019 
00020 #include "CapeTypes.hpp"
00021 #include "CapeException.hpp"
00022 
00023 
00024 namespace Common{
00025 
00026 
00032   namespace Identification{
00033 
00039     class ICapeIdentification   {
00040 #ifndef SWIG
00041 
00042       friend std::ostream& operator<<(std::ostream& out_file, const ICapeIdentification& identification);
00043 #endif
00044     public:
00046       virtual ~ICapeIdentification(){}
00047       
00049       virtual const Common::Types::CapeString& GetComponentName() const
00050         throw (Common::Error::ECapeUnknown) = 0;
00051 
00054       virtual void SetComponentName(const Common::Types::CapeString& _name)
00055         throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) = 0;
00056 
00058       virtual const Common::Types::CapeString& GetComponentDescription() const
00059         throw (Common::Error::ECapeUnknown) = 0;
00060 
00063       virtual void SetComponentDescription(const Common::Types::CapeString& _description)
00064         throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) = 0;
00065 
00066 #ifndef SWIG
00067 
00069       virtual ICapeIdentification* clone()
00070         throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl);
00071 #endif
00072     };
00073 
00074 #ifndef SWIG
00075 
00076       std::ostream& operator<<(std::ostream& out_file, const ICapeIdentification& identification);
00077 #endif
00078   }; 
00079 
00080 
00086   namespace Collection{
00087 
00103     class ICapeCollection : public Common::Identification::ICapeIdentification{
00104 #ifndef SWIG
00105 
00106       friend std::ostream& operator<<(std::ostream& out_file, ICapeCollection& coll);
00107 #endif
00108     public:
00110       virtual ~ICapeCollection(){}
00111       
00113       virtual Common::Types::CapeLong Count() const  
00114         throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) = 0;
00115       
00119       virtual Common::Identification::ICapeIdentification* ItemByIndex(Common::Types::CapeLong index) const
00120         throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument,
00121                Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfBounds) = 0;
00122 
00128       virtual Common::Identification::ICapeIdentification* ItemByName(const Common::Types::CapeString& name) const
00129         throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument,
00130                Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfBounds) = 0;
00131     };
00132 #ifndef SWIG
00133 
00134     std::ostream& operator<<(std::ostream& out_file, ICapeCollection& coll);
00135 #endif
00136   };
00137 
00138 
00144   namespace Utilities{
00145 
00149     class ICapeUtilities{
00150     public:
00152       virtual ~ICapeUtilities(){};
00153       
00163       virtual Common::Collection::ICapeCollection* GetParameters()
00164         throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation,
00165                Common::Error::ECapeNoImpl) = 0;
00166       
00180       virtual void SetSimulationContext(Common::Identification::ICapeIdentification* simContextManager)
00181         throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument,
00182                Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) = 0;
00183 
00196       virtual void Initialize()
00197         throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation,
00198                Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError,
00199                Common::Error::ECapeBadInvOrder) = 0;
00200 
00209       virtual void Terminate()
00210         throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources,
00211                Common::Error::ECapeBadInvOrder) = 0;
00212     };
00213   };
00214 };
00215 
00216 #endif // CAPE_BASIC_HPP