diff --git a/.gitattributes b/.gitattributes index f16551088c41fa64bb470c477b5944f21cd49b02..08e4a357b42b220e246a02b9a8f3089552dd93d8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -397,6 +397,7 @@ MAC/GCF/DEPENDENCIES -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/bootstrap -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/configure.in -text svneol=native#application/octet-stream +MAC/GCF/GCFCommon/include/GCF/GCF_Defines.h -text MAC/GCF/GCFCommon/pvss/scripts/libs/gcf-common.ctl -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/src/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/LogSys/CLP/Makefile.am -text svneol=native#application/octet-stream diff --git a/MAC/GCF/GCFCommon/include/GCF/GCF_Defines.h b/MAC/GCF/GCFCommon/include/GCF/GCF_Defines.h new file mode 100755 index 0000000000000000000000000000000000000000..5373684b63e967b9ed1205f747a642cc3af4540c --- /dev/null +++ b/MAC/GCF/GCFCommon/include/GCF/GCF_Defines.h @@ -0,0 +1,171 @@ +//# GCF_Defines.h: preprocessor definitions of various constants +//# +//# Copyright (C) 2002-2003 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id: GCF_Defines.h 10435 2007-08-02 21:38:38Z overeem $ + +#ifndef GCF_DEFINES_H +#define GCF_DEFINES_H + +#include <Common/LofarLogger.h> + +#include <Common/lofar_list.h> +#include <Common/lofar_map.h> +#include <Common/lofar_vector.h> + +using std::string; +using std::list; +using std::map; +using std::vector; + +namespace LOFAR { + namespace GCF { + namespace Common { + +// This header file will be included by each GCF API class header and provides +// therefore a number of defines, structs or macro's. They can/must be used when +// calling a GCF API class memberfunction. + +#define GCF_SYS_NAME_SEP ':' // separates the databasename from the ppropertyname +#define GCF_PROP_NAME_SEP '.' // separates the levels in property sets +#define GCF_SCOPE_NAME_SEP '_' // separates the levels in structure of property sets + +// possible results of GCF api class member calls. +enum TGCFResult +{ + GCF_NO_ERROR, + GCF_UNKNOWN_ERROR, + GCF_PML_ERROR, + GCF_EXTPS_LOAD_ERROR, + GCF_PS_CONFIGURE_ERROR, + GCF_EXTPS_UNLOAD_ERROR, + GCF_MYPS_ENABLE_ERROR, + GCF_MYPS_DISABLE_ERROR, + GCF_VALUESTRING_NOT_VALID, + GCF_DIFFERENT_TYPES, + GCF_BUSY, + GCF_ALREADY_LOADED, + GCF_NOT_LOADED, + GCF_PROP_NOT_VALID, + GCF_PROP_WRONG_TYPE, + GCF_PROP_NOT_IN_SET, + GCF_NO_PROPER_DATA, + GCF_SCOPE_ALREADY_REG, + GCF_ALREADY_SUBSCRIBED, + GCF_NOT_SUBSCRIBED, + GCF_WRONG_STATE, + GCF_PVSS_ERROR, +}; + +typedef unsigned char TAccessMode; + +#define GCF_READABLE_PROP 1 // means monitorable +#define GCF_WRITABLE_PROP 2 // means controllable +#define GCF_READWRITE_PROP (GCF_READABLE_PROP | GCF_WRITABLE_PROP) + +// struct for initalize properties with accessMode and/or defaultValue +// if defaultValue == 0 no default value will be set +struct TPropertyConfig +{ + char* propName; + TAccessMode accessMode; + char* defaultValue; +}; + +// start macro of a list of configurations of properties belonging to the same +// property set +#define PROPERTYCONFIGLIST_BEGIN(_name_) \ +const TPropertyConfig _name_[] = \ +{ + +// config item of the list of configurations of properties belonging to the same +// property set +#define PROPERTYCONFIGLIST_ITEM(_propname_,_flags_,_default_) \ +{_propname_,_flags_,_default_}, + +// end macro of a list of configurations of properties belonging to the same +// property set +#define PROPERTYCONFIGLIST_END \ +{0,0,0} \ +}; + +/** + * The enumeration of possible MAC property types + * In case a dynamic array will be used the type ID enumeration starts on + * 0x80. + * END_* are only delimeters + */ +typedef enum TMACValueType +{ + NO_LPT, LPT_BOOL, LPT_CHAR, LPT_UNSIGNED, LPT_INTEGER, + LPT_BIT32, LPT_BLOB, LPT_REF, LPT_DOUBLE, LPT_DATETIME, + LPT_STRING, END_LPT, + LPT_DYNARR = 0x80, LPT_DYNBOOL, LPT_DYNCHAR, LPT_DYNUNSIGNED, LPT_DYNINTEGER, + LPT_DYNBIT32, LPT_DYNBLOB, LPT_DYNREF, LPT_DYNDOUBLE, LPT_DYNDATETIME, + LPT_DYNSTRING, END_DYNLPT +}; + +// struct which holds the information about a property (name, type) +// the information is retrieved from PVSS and converted to this struct or set by +// the user +struct TPropertyInfo +{ + string propName; + TMACValueType type; + TPropertyInfo() : propName(), type(NO_LPT) {}; + TPropertyInfo(const char* pPropName, TMACValueType atype) : propName(pPropName), type(atype) {}; + TPropertyInfo(const TPropertyInfo& other) + { + if (this != &other) + { + type = other.type; + propName.replace(0, string::npos, other.propName); + } + }; +}; + +// PropertySet category +typedef enum TPSCategory +{ + // corresponding DP does not exists + // will be created on the first load request + PS_CAT_TEMPORARY, + // corresponding DP must exists + // only the usecount will be increased on load + PS_CAT_PERMANENT, + // corresponding DP must exists + // will be loaded automatically right after handled enable request in the PA + PS_CAT_PERM_AUTOLOAD, + // corresponding DP does not exists + // will be loaded automatically right after handled enable request in the PA + PS_CAT_TEMP_AUTOLOAD, +}; + +enum TKVLOrigin +{ + KVL_NO_ORIGIN, + KVL_ORIGIN_MAC, + KVL_ORIGIN_SHM, + KVL_ORIGIN_OPERATOR +}; + + } // namespace Common + } // namespace GCF +} // namespace LOFAR +#endif diff --git a/MAC/GCF/GCFCommon/include/GCF/Makefile.am b/MAC/GCF/GCFCommon/include/GCF/Makefile.am index 49da84c648339e592a9d1c72eed9cac7eec99f68..32e2ae4dddb079e54d0ba3c06028179732f2441e 100644 --- a/MAC/GCF/GCFCommon/include/GCF/Makefile.am +++ b/MAC/GCF/GCFCommon/include/GCF/Makefile.am @@ -2,6 +2,7 @@ pkgincludedir = $(includedir)/GCF pkginclude_HEADERS = \ CmdLine.h \ Utils.h \ + GCF_Defines.h \ GCF_ServiceInfo.h \ Thread.h \ Mutex.h