Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 /* 00002 * 00003 * Licensed to the Apache Software Foundation (ASF) under one 00004 * or more contributor license agreements. See the NOTICE file 00005 * distributed with this work for additional information 00006 * regarding copyright ownership. The ASF licenses this file 00007 * to you under the Apache License, Version 2.0 (the 00008 * "License"); you may not use this file except in compliance 00009 * with the License. You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, 00014 * software distributed under the License is distributed on an 00015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00016 * KIND, either express or implied. See the License for the 00017 * specific language governing permissions and limitations 00018 * under the License. 00019 * 00020 */ 00021 #ifndef _QPID_CONSOLE_CLASSKEY_H_ 00022 #define _QPID_CONSOLE_CLASSKEY_H_ 00023 00024 #include <string> 00025 #include "qpid/console/ConsoleImportExport.h" 00026 #include "qpid/console/Package.h" 00027 #include "qpid/framing/Buffer.h" 00028 00029 namespace qpid { 00030 namespace console { 00031 00036 class QPID_CONSOLE_EXTERN ClassKey { 00037 public: 00038 static const int HASH_SIZE = 16; 00039 00040 ClassKey(const std::string& package, const std::string& name, const uint8_t* hash); 00041 00042 const std::string& getPackageName() const { return package; } 00043 const std::string& getClassName() const { return name; } 00044 const uint8_t* getHash() const { return hash; } 00045 std::string getHashString() const; 00046 std::string str() const; 00047 bool operator==(const ClassKey& other) const; 00048 bool operator!=(const ClassKey& other) const; 00049 bool operator<(const ClassKey& other) const; 00050 bool operator>(const ClassKey& other) const; 00051 bool operator<=(const ClassKey& other) const; 00052 bool operator>=(const ClassKey& other) const; 00053 void encode(framing::Buffer& buffer) const; 00054 00055 private: 00056 std::string package; 00057 std::string name; 00058 uint8_t hash[HASH_SIZE]; 00059 }; 00060 00061 QPID_CONSOLE_EXTERN std::ostream& operator<<(std::ostream& o, const ClassKey& k); 00062 } 00063 } 00064 00065 00066 #endif