00001 #ifndef PropertyH 00002 #define PropertyH 00003 00004 /******************************************************************************* 00005 Copyright 2002,2003 Petr Kulhanek 00006 00007 This file is part of Core plugin. 00008 00009 Core plugin is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 Core plugin is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with Core plugin; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 *******************************************************************************/ 00023 /******************************************************************************* 00024 ** PROJECT: Project NEMESIS 00025 ** FILE: Property 00026 ** FUNCTION: calculation property 00027 ** VERSION: 1.0 00028 ** LANGUAGE: CBuilder C++ 00029 ** TARGET COMPUTER: IBM PC 00030 ** PROGRAMMER: Petr Kulhánek 00031 ** HISTORY: 00032 VERSION DATE NOTE 00033 2002-09 1.0 00034 *******************************************************************************/ 00035 00039 /* HEADER FILES ***************************************************************/ 00040 00041 #include "CoreMainHeader.h" 00042 #include "ExtObject.h" 00043 00044 /* HEADER FILES END ***********************************************************/ 00045 00046 class CPluginObjectInfo; 00047 class CJob; 00048 class CCalculation; 00049 class CXMLElement; 00050 class CMoleculeInfo; 00051 00052 //--------------------------------------------------------------------------- 00053 00055 00058 class NEMESIS_CORE_PACKAGE CProperty : public CExtObject { 00059 public: 00060 __fastcall CProperty(CPluginObjectInfo* objectinfo,CCalculation* p_cal); 00061 void __fastcall RemoveFromBaseList(void); 00062 00063 __property CCalculation* Calculation = {read=FCalculation}; 00064 00065 // 00066 bool __fastcall RemovePropertyData(void); 00067 00068 // load and save configurational data and extracted data ---------------------- 00069 bool __fastcall Load(CXMLElement* p_el); 00070 bool __fastcall Save(CXMLElement* p_el); 00071 00072 // owner job manipulation ----------------------------------------------------- 00073 inline void __fastcall SetOwnerJob(CJob* p_job); 00074 inline CJob* __fastcall GetOwnerJob(void); 00075 inline CCalculation* __fastcall GetCalculation(void); 00076 00077 // prepare and extract data from calculation ---------------------------------- 00078 virtual bool __fastcall WriteInputData(CXMLElement* p_ele); 00079 bool __fastcall ExtractResultData(void); 00080 virtual bool __fastcall RemovePropertySpecificData(void); 00081 00082 CSmallString __fastcall GetResultFileName(void); 00083 virtual bool __fastcall ContainData(void); // inform that property contains any data 00084 inline bool __fastcall IsCompleted(void); // inform that property contains all data 00085 00086 // private data section ------------------------------------------------------- 00087 private: 00088 CCalculation* FCalculation; 00089 CJob* Job; // owing job 00090 bool Completed; 00091 00092 virtual bool __fastcall LoadData(CXMLElement* p_ele); 00093 virtual bool __fastcall SaveData(CXMLElement* p_ele); 00094 00095 // raw function for extraction of data, only if stamps are not identical 00096 virtual bool __fastcall ExtractDataFromResult(bool& completed); 00097 }; 00098 00099 //--------------------------------------------------------------------------- 00100 00101 DECLARE_EVENT(Property_SetContainData); 00102 00103 //--------------------------------------------------------------------------- 00104 00105 inline void __fastcall CProperty::SetOwnerJob(CJob* p_job) 00106 { 00107 Job = p_job; 00108 } 00109 00110 //--------------------------------------------------------------------------- 00111 00112 inline CJob* __fastcall CProperty::GetOwnerJob(void) 00113 { 00114 return(Job); 00115 } 00116 00117 //--------------------------------------------------------------------------- 00118 00119 inline bool __fastcall CProperty::IsCompleted(void) 00120 { 00121 return(Completed); 00122 } 00123 00124 //--------------------------------------------------------------------------- 00125 00126 inline CCalculation* __fastcall CProperty::GetCalculation(void) 00127 { 00128 return(FCalculation); 00129 } 00130 00131 //--------------------------------------------------------------------------- 00132 00133 00134 #endif