diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-05-27 15:44:23 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-05-27 15:44:23 +0000 |
commit | 66765100f4257159622cefe57bed50125a5ad017 (patch) | |
tree | a88ee23bb194eb91f0ebb2d9b23ff423e3ea8e37 /cpp/managementgen/qmfgen/templates | |
parent | 1aeaa7b16e5ce54f10c901d75c4d40f9f88b9db6 (diff) | |
parent | 88b98b2f4152ef59a671fad55a0d08338b6b78ca (diff) | |
download | qpid-python-rajith_jms_client.tar.gz |
Creating a branch for experimenting with some ideas for JMS client.rajith_jms_client
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rajith_jms_client@1128369 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/managementgen/qmfgen/templates')
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Args.h | 40 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/CMakeLists.cmake | 39 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Class.cpp | 339 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Class.h | 122 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Event.cpp | 101 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Event.h | 58 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Makefile.mk | 40 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Package.cpp | 32 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/Package.h | 41 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/V2Package.cpp | 37 | ||||
-rw-r--r-- | cpp/managementgen/qmfgen/templates/V2Package.h | 46 |
11 files changed, 0 insertions, 895 deletions
diff --git a/cpp/managementgen/qmfgen/templates/Args.h b/cpp/managementgen/qmfgen/templates/Args.h deleted file mode 100644 index 89a5bec9b9..0000000000 --- a/cpp/managementgen/qmfgen/templates/Args.h +++ /dev/null @@ -1,40 +0,0 @@ -/*MGEN:commentPrefix=//*/ -#ifndef _ARGS_/*MGEN:Method.NameUpper*/_ -#define _ARGS_/*MGEN:Method.NameUpper*/_ - -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "qpid/management/Args.h" -#include <string> - -namespace qmf { -/*MGEN:Method.OpenNamespaces*/ - - class Args/*MGEN:Method.NameCamel*/ : public ::qpid::management::Args -{ - public: -/*MGEN:Method.Arguments*/ -}; - -}/*MGEN:Method.CloseNamespaces*/ - -#endif /*!_ARGS_/*MGEN:Method.NameUpper*/_*/ diff --git a/cpp/managementgen/qmfgen/templates/CMakeLists.cmake b/cpp/managementgen/qmfgen/templates/CMakeLists.cmake deleted file mode 100644 index d8a3b91b10..0000000000 --- a/cpp/managementgen/qmfgen/templates/CMakeLists.cmake +++ /dev/null @@ -1,39 +0,0 @@ -#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-/*MGEN:commentPrefix=#*/
-/*MGEN:Root.Disclaimer*/
-/*MGEN:IF(CMakeLists.QpidBroker)*/
-/*MGEN:mgenDir=${mgen_dir}*/
-/*MGEN:specDir=${qpid-cpp_SOURCE_DIR}/../specs*/
-
-set(mgen_generator /*MGEN:CMakeLists.GenSources*/)
-
-set(mgen_broker_cpp /*MGEN:CMakeLists.GenCppFiles*/)
-
-# Header file install rules.
-#/*MGEN:CMakeLists.HeaderInstalls*/
-#if GENERATE
-#$(srcdir)/managementgen.mk: $(mgen_generator)
-# $(mgen_cmd)
-#
-#$(mgen_generator):
-#endif
-#/*MGEN:ENDIF*/
-
-set(qmfgen_sources /*MGEN:CMakeLists.GeneratedFiles*/)
diff --git a/cpp/managementgen/qmfgen/templates/Class.cpp b/cpp/managementgen/qmfgen/templates/Class.cpp deleted file mode 100644 index fc0b9c8177..0000000000 --- a/cpp/managementgen/qmfgen/templates/Class.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/*MGEN:commentPrefix=//*/ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "qpid/management/Manageable.h" -#include "qpid/management/Buffer.h" -#include "qpid/types/Variant.h" -#include "qpid/amqp_0_10/Codecs.h" -#include "qpid//*MGEN:Class.AgentHeaderLocation*//ManagementAgent.h" -#include "/*MGEN:Class.NameCap*/.h" -/*MGEN:Class.MethodArgIncludes*/ -#include <iostream> -#include <sstream> - -using namespace qmf::/*MGEN:Class.Namespace*/; -using qpid::management::ManagementAgent; -using qpid::management::Manageable; -using qpid::management::ManagementObject; -using qpid::management::Args; -using qpid::management::Mutex; -using std::string; - -string /*MGEN:Class.NameCap*/::packageName = string ("/*MGEN:Class.NamePackageLower*/"); -string /*MGEN:Class.NameCap*/::className = string ("/*MGEN:Class.NameLower*/"); -uint8_t /*MGEN:Class.NameCap*/::md5Sum[MD5_LEN] = - {/*MGEN:Class.SchemaMD5*/}; - -/*MGEN:Class.NameCap*/::/*MGEN:Class.NameCap*/ (ManagementAgent*, Manageable* _core/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/) : - ManagementObject(_core)/*MGEN:Class.ConstructorInits*/ -{ - /*MGEN:Class.ParentRefAssignment*/ -/*MGEN:Class.InitializeElements*/ -/*MGEN:IF(Class.ExistOptionals)*/ - // Optional properties start out not-present - for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++) - presenceMask[idx] = 0; -/*MGEN:ENDIF*/ -/*MGEN:IF(Class.ExistPerThreadStats)*/ - perThreadStatsArray = new struct PerThreadStats*[maxThreads]; - for (int idx = 0; idx < maxThreads; idx++) - perThreadStatsArray[idx] = 0; -/*MGEN:ENDIF*/ -} - -/*MGEN:Class.NameCap*/::~/*MGEN:Class.NameCap*/ () -{ -/*MGEN:IF(Class.ExistPerThreadStats)*/ - for (int idx = 0; idx < maxThreads; idx++) - if (perThreadStatsArray[idx] != 0) - delete perThreadStatsArray[idx]; - delete[] perThreadStatsArray; -/*MGEN:ENDIF*/ -} - -namespace { - const string NAME("name"); - const string TYPE("type"); - const string ACCESS("access"); - const string IS_INDEX("index"); - const string IS_OPTIONAL("optional"); - const string UNIT("unit"); - const string MIN("min"); - const string MAX("max"); - const string MAXLEN("maxlen"); - const string DESC("desc"); - const string ARGCOUNT("argCount"); - const string ARGS("args"); - const string DIR("dir"); - const string DEFAULT("default"); -} - -void /*MGEN:Class.NameCap*/::registerSelf(ManagementAgent* agent) -{ - agent->registerClass(packageName, className, md5Sum, writeSchema); -} - -void /*MGEN:Class.NameCap*/::writeSchema (std::string& schema) -{ - const int _bufSize=65536; - char _msgChars[_bufSize]; - ::qpid::management::Buffer buf(_msgChars, _bufSize); - ::qpid::types::Variant::Map ft; - - // Schema class header: - buf.putOctet (CLASS_KIND_TABLE); - buf.putShortString (packageName); // Package Name - buf.putShortString (className); // Class Name - buf.putBin128 (md5Sum); // Schema Hash - buf.putShort (/*MGEN:Class.ConfigCount*/); // Config Element Count - buf.putShort (/*MGEN:Class.InstCount*/); // Inst Element Count - buf.putShort (/*MGEN:Class.MethodCount*/); // Method Count - - // Properties -/*MGEN:Class.PropertySchema*/ - // Statistics -/*MGEN:Class.StatisticSchema*/ - // Methods -/*MGEN:Class.MethodSchema*/ - { - uint32_t _len = buf.getPosition(); - buf.reset(); - buf.getRawData(schema, _len); - } -} - -/*MGEN:IF(Class.ExistPerThreadStats)*/ -void /*MGEN:Class.NameCap*/::aggregatePerThreadStats(struct PerThreadStats* totals) const -{ -/*MGEN:Class.InitializeTotalPerThreadStats*/ - for (int idx = 0; idx < maxThreads; idx++) { - struct PerThreadStats* threadStats = perThreadStatsArray[idx]; - if (threadStats != 0) { -/*MGEN:Class.AggregatePerThreadStats*/ - } - } -} -/*MGEN:ENDIF*/ - -/*MGEN:IF(Root.GenQMFv1)*/ -uint32_t /*MGEN:Class.NameCap*/::writePropertiesSize() const -{ - uint32_t size = writeTimestampsSize(); -/*MGEN:IF(Class.ExistOptionals)*/ - size += /*MGEN:Class.PresenceMaskBytes*/; -/*MGEN:ENDIF*/ -/*MGEN:Class.SizeProperties*/ - return size; -} - -void /*MGEN:Class.NameCap*/::readProperties (const std::string& _sBuf) -{ - char *_tmpBuf = new char[_sBuf.length()]; - memcpy(_tmpBuf, _sBuf.data(), _sBuf.length()); - ::qpid::management::Buffer buf(_tmpBuf, _sBuf.length()); - Mutex::ScopedLock mutex(accessLock); - - { - std::string _tbuf; - buf.getRawData(_tbuf, writeTimestampsSize()); - readTimestamps(_tbuf); - } - -/*MGEN:IF(Class.ExistOptionals)*/ - for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++) - presenceMask[idx] = buf.getOctet(); -/*MGEN:ENDIF*/ -/*MGEN:Class.ReadProperties*/ - - delete [] _tmpBuf; -} - -void /*MGEN:Class.NameCap*/::writeProperties (std::string& _sBuf) const -{ - const int _bufSize=65536; - char _msgChars[_bufSize]; - ::qpid::management::Buffer buf(_msgChars, _bufSize); - - Mutex::ScopedLock mutex(accessLock); - configChanged = false; - - { - std::string _tbuf; - writeTimestamps(_tbuf); - buf.putRawData(_tbuf); - } - - -/*MGEN:IF(Class.ExistOptionals)*/ - for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++) - buf.putOctet(presenceMask[idx]); -/*MGEN:ENDIF*/ -/*MGEN:Class.WriteProperties*/ - - uint32_t _bufLen = buf.getPosition(); - buf.reset(); - - buf.getRawData(_sBuf, _bufLen); -} - -void /*MGEN:Class.NameCap*/::writeStatistics (std::string& _sBuf, bool skipHeaders) -{ - const int _bufSize=65536; - char _msgChars[_bufSize]; - ::qpid::management::Buffer buf(_msgChars, _bufSize); - - Mutex::ScopedLock mutex(accessLock); - instChanged = false; -/*MGEN:IF(Class.ExistPerThreadAssign)*/ - for (int idx = 0; idx < maxThreads; idx++) { - struct PerThreadStats* threadStats = perThreadStatsArray[idx]; - if (threadStats != 0) { -/*MGEN:Class.PerThreadAssign*/ - } - } -/*MGEN:ENDIF*/ -/*MGEN:IF(Class.ExistPerThreadStats)*/ - struct PerThreadStats totals; - aggregatePerThreadStats(&totals); -/*MGEN:ENDIF*/ -/*MGEN:Class.Assign*/ - if (!skipHeaders) { - std::string _tbuf; - writeTimestamps (_tbuf); - buf.putRawData(_tbuf); - } - -/*MGEN:Class.WriteStatistics*/ - - // Maintenance of hi-lo statistics -/*MGEN:Class.HiLoStatResets*/ -/*MGEN:IF(Class.ExistPerThreadResets)*/ - for (int idx = 0; idx < maxThreads; idx++) { - struct PerThreadStats* threadStats = perThreadStatsArray[idx]; - if (threadStats != 0) { -/*MGEN:Class.PerThreadHiLoStatResets*/ - } - } -/*MGEN:ENDIF*/ - - uint32_t _bufLen = buf.getPosition(); - buf.reset(); - - buf.getRawData(_sBuf, _bufLen); -} - -void /*MGEN:Class.NameCap*/::doMethod (/*MGEN:Class.DoMethodArgs*/) -{ - Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD; - std::string text; - - bool _matched = false; - - const int _bufSize=65536; - char _msgChars[_bufSize]; - ::qpid::management::Buffer outBuf(_msgChars, _bufSize); - -/*MGEN:Class.MethodHandlers*/ - - if (!_matched) { - outBuf.putLong(status); - outBuf.putShortString(Manageable::StatusText(status, text)); - } - - uint32_t _bufLen = outBuf.getPosition(); - outBuf.reset(); - - outBuf.getRawData(outStr, _bufLen); -} -/*MGEN:ENDIF*/ -std::string /*MGEN:Class.NameCap*/::getKey() const -{ - std::stringstream key; - -/*MGEN:Class.PrimaryKey*/ - return key.str(); -} - - - -void /*MGEN:Class.NameCap*/::mapEncodeValues (::qpid::types::Variant::Map& _map, - bool includeProperties, - bool includeStatistics) -{ - using namespace ::qpid::types; - Mutex::ScopedLock mutex(accessLock); - - if (includeProperties) { - configChanged = false; -/*MGEN:Class.MapEncodeProperties*/ - } - - if (includeStatistics) { - instChanged = false; -/*MGEN:IF(Class.ExistPerThreadAssign)*/ - for (int idx = 0; idx < maxThreads; idx++) { - struct PerThreadStats* threadStats = perThreadStatsArray[idx]; - if (threadStats != 0) { -/*MGEN:Class.PerThreadAssign*/ - } - } -/*MGEN:ENDIF*/ -/*MGEN:IF(Class.ExistPerThreadStats)*/ - struct PerThreadStats totals; - aggregatePerThreadStats(&totals); -/*MGEN:ENDIF*/ -/*MGEN:Class.Assign*/ - -/*MGEN:Class.MapEncodeStatistics*/ - - // Maintenance of hi-lo statistics -/*MGEN:Class.HiLoStatResets*/ -/*MGEN:IF(Class.ExistPerThreadResets)*/ - for (int idx = 0; idx < maxThreads; idx++) { - struct PerThreadStats* threadStats = perThreadStatsArray[idx]; - if (threadStats != 0) { -/*MGEN:Class.PerThreadHiLoStatResets*/ - } - } -/*MGEN:ENDIF*/ - } -} - -void /*MGEN:Class.NameCap*/::mapDecodeValues (const ::qpid::types::Variant::Map& _map) -{ - ::qpid::types::Variant::Map::const_iterator _i; - Mutex::ScopedLock mutex(accessLock); -/*MGEN:IF(Class.ExistOptionals)*/ - bool _found; -/*MGEN:ENDIF*/ -/*MGEN:Class.MapDecodeProperties*/ -} - -void /*MGEN:Class.NameCap*/::doMethod (/*MGEN:Class.DoMapMethodArgs*/) -{ - Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD; - std::string text; - -/*MGEN:Class.MapMethodHandlers*/ - outMap["_status_code"] = (uint32_t) status; - outMap["_status_text"] = Manageable::StatusText(status, text); -} diff --git a/cpp/managementgen/qmfgen/templates/Class.h b/cpp/managementgen/qmfgen/templates/Class.h deleted file mode 100644 index 4bcd423a26..0000000000 --- a/cpp/managementgen/qmfgen/templates/Class.h +++ /dev/null @@ -1,122 +0,0 @@ -/*MGEN:commentPrefix=//*/ -#ifndef _MANAGEMENT_/*MGEN:Class.NameUpper*/_ -#define _MANAGEMENT_/*MGEN:Class.NameUpper*/_ - -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "qpid/management/ManagementObject.h" - -namespace qpid { - namespace management { - class ManagementAgent; - } -} - -namespace qmf { -/*MGEN:Class.OpenNamespaces*/ - -class /*MGEN:Class.NameCap*/ : public ::qpid::management::ManagementObject -{ - private: - - static std::string packageName; - static std::string className; - static uint8_t md5Sum[MD5_LEN]; -/*MGEN:IF(Class.ExistOptionals)*/ - uint8_t presenceMask[/*MGEN:Class.PresenceMaskBytes*/]; -/*MGEN:Class.PresenceMaskConstants*/ -/*MGEN:ENDIF*/ - - // Properties -/*MGEN:Class.ConfigDeclarations*/ - // Statistics -/*MGEN:Class.InstDeclarations*/ -/*MGEN:IF(Class.ExistPerThreadStats)*/ - // Per-Thread Statistics - struct PerThreadStats { -/*MGEN:Class.PerThreadDeclarations*/ - }; - - struct PerThreadStats** perThreadStatsArray; - - inline struct PerThreadStats* getThreadStats() { - int idx = getThreadIndex(); - struct PerThreadStats* threadStats = perThreadStatsArray[idx]; - if (threadStats == 0) { - threadStats = new(PerThreadStats); - perThreadStatsArray[idx] = threadStats; -/*MGEN:Class.InitializePerThreadElements*/ - } - return threadStats; - } - - void aggregatePerThreadStats(struct PerThreadStats*) const; -/*MGEN:ENDIF*/ - public: - static void writeSchema(std::string& schema); - void mapEncodeValues(::qpid::types::Variant::Map& map, - bool includeProperties=true, - bool includeStatistics=true); - void mapDecodeValues(const ::qpid::types::Variant::Map& map); - void doMethod(std::string& methodName, - const ::qpid::types::Variant::Map& inMap, - ::qpid::types::Variant::Map& outMap, - const std::string& userId); - std::string getKey() const; -/*MGEN:IF(Root.GenQMFv1)*/ - uint32_t writePropertiesSize() const; - void readProperties(const std::string& buf); - void writeProperties(std::string& buf) const; - void writeStatistics(std::string& buf, bool skipHeaders = false); - void doMethod(std::string& methodName, - const std::string& inBuf, - std::string& outBuf, - const std::string& userId); -/*MGEN:ENDIF*/ - - writeSchemaCall_t getWriteSchemaCall() { return writeSchema; } -/*MGEN:IF(Class.NoStatistics)*/ - // Stub for getInstChanged. There are no statistics in this class. - bool getInstChanged() { return false; } - bool hasInst() { return false; } -/*MGEN:ENDIF*/ - - /*MGEN:Class.NameCap*/(::qpid::management::ManagementAgent* agent, - ::qpid::management::Manageable* coreObject/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/); - ~/*MGEN:Class.NameCap*/(); - - /*MGEN:Class.SetGeneralReferenceDeclaration*/ - - static void registerSelf(::qpid::management::ManagementAgent* agent); - std::string& getPackageName() const { return packageName; } - std::string& getClassName() const { return className; } - uint8_t* getMd5Sum() const { return md5Sum; } - - // Method IDs -/*MGEN:Class.MethodIdDeclarations*/ - // Accessor Methods -/*MGEN:Class.AccessorMethods*/ -}; - -}/*MGEN:Class.CloseNamespaces*/ - -#endif /*!_MANAGEMENT_/*MGEN:Class.NameUpper*/_*/ diff --git a/cpp/managementgen/qmfgen/templates/Event.cpp b/cpp/managementgen/qmfgen/templates/Event.cpp deleted file mode 100644 index a8fdd0bd92..0000000000 --- a/cpp/managementgen/qmfgen/templates/Event.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/*MGEN:commentPrefix=//*/ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "qpid/management/Manageable.h" -#include "qpid/management/Buffer.h" -#include "qpid/types/Variant.h" -#include "qpid/amqp_0_10/Codecs.h" -#include "qpid//*MGEN:Event.AgentHeaderLocation*//ManagementAgent.h" -#include "Event/*MGEN:Event.NameCap*/.h" - -using namespace qmf::/*MGEN:Event.Namespace*/; -using qpid::management::ManagementAgent; -using qpid::management::Manageable; -using qpid::management::ManagementObject; -using qpid::management::Args; -using qpid::management::Mutex; -using std::string; - -string Event/*MGEN:Event.NameCap*/::packageName = string ("/*MGEN:Event.NamePackageLower*/"); -string Event/*MGEN:Event.NameCap*/::eventName = string ("/*MGEN:Event.Name*/"); -uint8_t Event/*MGEN:Event.NameCap*/::md5Sum[16] = - {/*MGEN:Event.SchemaMD5*/}; - -Event/*MGEN:Event.NameCap*/::Event/*MGEN:Event.NameCap*/ (/*MGEN:Event.ConstructorArgs*/) : - /*MGEN:Event.ConstructorInits*/ -{} - -namespace { - const string NAME("name"); - const string TYPE("type"); - const string DESC("desc"); - const string ARGCOUNT("argCount"); - const string ARGS("args"); -} - -void Event/*MGEN:Event.NameCap*/::registerSelf(ManagementAgent* agent) -{ - agent->registerEvent(packageName, eventName, md5Sum, writeSchema); -} - -void Event/*MGEN:Event.NameCap*/::writeSchema (std::string& schema) -{ - const int _bufSize = 65536; - char _msgChars[_bufSize]; - ::qpid::management::Buffer buf(_msgChars, _bufSize); - ::qpid::types::Variant::Map ft; - - // Schema class header: - buf.putOctet (CLASS_KIND_EVENT); - buf.putShortString (packageName); // Package Name - buf.putShortString (eventName); // Event Name - buf.putBin128 (md5Sum); // Schema Hash - buf.putShort (/*MGEN:Event.ArgCount*/); // Argument Count - - // Arguments -/*MGEN:Event.ArgSchema*/ - { - uint32_t _len = buf.getPosition(); - buf.reset(); - buf.getRawData(schema, _len); - } -} - -void Event/*MGEN:Event.NameCap*/::encode(std::string& _sBuf) const -{ - const int _bufSize=65536; - char _msgChars[_bufSize]; - ::qpid::management::Buffer buf(_msgChars, _bufSize); - -/*MGEN:Event.ArgEncodes*/ - - uint32_t _bufLen = buf.getPosition(); - buf.reset(); - - buf.getRawData(_sBuf, _bufLen); -} - -void Event/*MGEN:Event.NameCap*/::mapEncode(::qpid::types::Variant::Map& map) const -{ - using namespace ::qpid::types; -/*MGEN:Event.ArgMap*/ -} diff --git a/cpp/managementgen/qmfgen/templates/Event.h b/cpp/managementgen/qmfgen/templates/Event.h deleted file mode 100644 index 4f912cf220..0000000000 --- a/cpp/managementgen/qmfgen/templates/Event.h +++ /dev/null @@ -1,58 +0,0 @@ -/*MGEN:commentPrefix=//*/ -#ifndef _MANAGEMENT_/*MGEN:Event.NameUpper*/_ -#define _MANAGEMENT_/*MGEN:Event.NameUpper*/_ - -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "qpid/management/ManagementEvent.h" - -namespace qmf { -/*MGEN:Event.OpenNamespaces*/ - -class Event/*MGEN:Event.NameCap*/ : public ::qpid::management::ManagementEvent -{ - private: - static void writeSchema (std::string& schema); - static std::string packageName; - static std::string eventName; - static uint8_t md5Sum[MD5_LEN]; - -/*MGEN:Event.ArgDeclarations*/ - - public: - writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; } - - Event/*MGEN:Event.NameCap*/(/*MGEN:Event.ConstructorArgs*/); - ~Event/*MGEN:Event.NameCap*/() {}; - - static void registerSelf(::qpid::management::ManagementAgent* agent); - std::string& getPackageName() const { return packageName; } - std::string& getEventName() const { return eventName; } - uint8_t* getMd5Sum() const { return md5Sum; } - uint8_t getSeverity() const { return /*MGEN:Event.Severity*/; } - void encode(std::string& buffer) const; - void mapEncode(::qpid::types::Variant::Map& map) const; -}; - -}/*MGEN:Event.CloseNamespaces*/ - -#endif /*!_MANAGEMENT_/*MGEN:Event.NameUpper*/_*/ diff --git a/cpp/managementgen/qmfgen/templates/Makefile.mk b/cpp/managementgen/qmfgen/templates/Makefile.mk deleted file mode 100644 index b9adb4a2d2..0000000000 --- a/cpp/managementgen/qmfgen/templates/Makefile.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -/*MGEN:commentPrefix=#*/ -/*MGEN:Root.Disclaimer*/ -/*MGEN:IF(Makefile.QpidBroker)*/ -/*MGEN:mgenDir=$(mgen_dir)*/ -/*MGEN:specDir=$(top_srcdir)/../specs*/ - -mgen_generator=/*MGEN:Makefile.GenSources*/ - -mgen_broker_cpp=/*MGEN:Makefile.GenCppFiles*/ - -# Header file install rules. -/*MGEN:Makefile.HeaderInstalls*/ -if GENERATE -$(srcdir)/managementgen.mk: $(mgen_generator) - $(mgen_cmd) - -$(mgen_generator): -endif -/*MGEN:ENDIF*/ - -qmfgen_sources=/*MGEN:Makefile.GeneratedFiles*/ - diff --git a/cpp/managementgen/qmfgen/templates/Package.cpp b/cpp/managementgen/qmfgen/templates/Package.cpp deleted file mode 100644 index f6bd7f4654..0000000000 --- a/cpp/managementgen/qmfgen/templates/Package.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*MGEN:commentPrefix=//*/ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "Package.h" -/*MGEN:Schema.ClassIncludes*/ - -using namespace qmf::/*MGEN:Schema.Namespace*/; - -Package::Package (::qpid::management::ManagementAgent* agent) -{ -/*MGEN:Schema.ClassRegisters*/ -} - diff --git a/cpp/managementgen/qmfgen/templates/Package.h b/cpp/managementgen/qmfgen/templates/Package.h deleted file mode 100644 index 569c7cfb33..0000000000 --- a/cpp/managementgen/qmfgen/templates/Package.h +++ /dev/null @@ -1,41 +0,0 @@ -/*MGEN:commentPrefix=//*/ -#ifndef _MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_ -#define _MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_ - -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "qpid//*MGEN:Class.AgentHeaderLocation*//ManagementAgent.h" - -namespace qmf { -/*MGEN:Class.OpenNamespaces*/ - -class Package -{ - public: - Package (::qpid::management::ManagementAgent* agent); - ~Package () {} -}; - -}/*MGEN:Class.CloseNamespaces*/ - - -#endif /*!_MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_*/ diff --git a/cpp/managementgen/qmfgen/templates/V2Package.cpp b/cpp/managementgen/qmfgen/templates/V2Package.cpp deleted file mode 100644 index 2b6e231fe9..0000000000 --- a/cpp/managementgen/qmfgen/templates/V2Package.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/*MGEN:commentPrefix=//*/ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include "QmfPackage.h" -#include <qmf/Schema.h> -#include <qmf/SchemaProperty.h> -#include <qmf/SchemaMethod.h> -#include <string> - -using namespace std; -using namespace qmf::/*MGEN:Schema.Namespace*/; - -void PackageDefinition::configure(::qmf::AgentSession& session) -{ - string package("/*MGEN:Schema.PackageName*/"); -/*MGEN:Schema.V2ClassDefines*/ -} - diff --git a/cpp/managementgen/qmfgen/templates/V2Package.h b/cpp/managementgen/qmfgen/templates/V2Package.h deleted file mode 100644 index 1d4f907ab3..0000000000 --- a/cpp/managementgen/qmfgen/templates/V2Package.h +++ /dev/null @@ -1,46 +0,0 @@ -/*MGEN:commentPrefix=//*/ -#ifndef _QMF_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_ -#define _QMF_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_ - -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -/*MGEN:Root.Disclaimer*/ - -#include <qmf/AgentSession.h> -#include <qmf/Schema.h> -#include <qmf/Data.h> -#include <qmf/DataAddr.h> - -namespace qmf { -/*MGEN:Class.OpenNamespaces*/ - -class PackageDefinition -{ - public: - ~PackageDefinition() {} - void configure(::qmf::AgentSession& session); - -/*MGEN:Schema.V2ClassMembers*/ -}; - -}/*MGEN:Class.CloseNamespaces*/ - - -#endif /*!_QMF_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_*/ |