Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Package.h
Go to the documentation of this file.
1 /*
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements. See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership. The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License. You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied. See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 #ifndef _QPID_CONSOLE_PACKAGE_H_
22 #define _QPID_CONSOLE_PACKAGE_H_
23 
24 #include <string>
25 #include <map>
27 #include "qpid/sys/IntegerTypes.h"
28 
29 namespace qpid {
30 namespace console {
31  struct SchemaClass;
32 
37  class Package {
38  public:
39  Package(const std::string& n) : name(n) {}
40  const std::string& getName() const { return name; }
41 
42  private:
43  friend class SessionManager;
44  struct NameHash {
45  std::string name;
46  uint8_t hash[16];
47  NameHash(const std::string& n, const uint8_t* h) : name(n) {
48  for (int i = 0; i < 16; i++)
49  hash[i] = h[i];
50  }
51  };
52 
53  struct NameHashComp {
54  bool operator() (const NameHash& lhs, const NameHash& rhs) const
55  {
56  if (lhs.name != rhs.name)
57  return lhs.name < rhs.name;
58  else
59  for (int i = 0; i < 16; i++)
60  if (lhs.hash[i] != rhs.hash[i])
61  return lhs.hash[i] < rhs.hash[i];
62  return false;
63  }
64  };
65 
66  typedef std::map<NameHash, SchemaClass*, NameHashComp> ClassMap;
67 
68  const std::string name;
69  ClassMap classes;
70 
71  SchemaClass* getClass(const std::string& className, uint8_t* hash);
72  void addClass(const std::string& className, uint8_t* hash,
73  SchemaClass* schemaClass);
74  };
75 }
76 }
77 
78 #endif

Qpid C++ API Reference
Generated on Tue Sep 25 2012 for Qpid C++ Client API by doxygen 1.8.1.1