qpid/console/ClassKey.h Source File

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qpid/console/ClassKey.h
Go to the documentation of this file.

    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_CLASS_EXTERN ClassKey {
    00037     public:
    00038         QPID_CONSOLE_EXTERN static const int HASH_SIZE = 16;
    00039
    00040         QPID_CONSOLE_EXTERN ClassKey(const std::string& package, const std::string& name, const uint8_t* hash);
    00041
    00042         const QPID_CONSOLE_EXTERN std::string& getPackageName() const { return package; }
    00043         const QPID_CONSOLE_EXTERN std::string& getClassName() const { return name; }
    00044         const QPID_CONSOLE_EXTERN uint8_t* getHash() const { return hash; }
    00045         QPID_CONSOLE_EXTERN std::string getHashString() const;
    00046         QPID_CONSOLE_EXTERN std::string str() const;
    00047         QPID_CONSOLE_EXTERN bool operator==(const ClassKey& other) const;
    00048         QPID_CONSOLE_EXTERN bool operator!=(const ClassKey& other) const;
    00049         QPID_CONSOLE_EXTERN bool operator<(const ClassKey& other) const;
    00050         QPID_CONSOLE_EXTERN bool operator>(const ClassKey& other) const;
    00051         QPID_CONSOLE_EXTERN bool operator<=(const ClassKey& other) const;
    00052         QPID_CONSOLE_EXTERN bool operator>=(const ClassKey& other) const;
    00053         QPID_CONSOLE_EXTERN 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