Qpid .NET Messaging API  0.24
 All Classes Namespaces Files Functions Variables Typedefs
TypeTranslator.h
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 #pragma once
20 
21 #include <windows.h>
22 #include <msclr\lock.h>
23 #include <oletx2xa.h>
24 #include <string>
25 #include <limits>
26 
27 #include "qpid/types/Variant.h"
28 
29 #include "QpidTypeCheck.h"
30 
31 namespace Org {
32 namespace Apache {
33 namespace Qpid {
34 namespace Messaging {
35 
40  public ref class TypeTranslator sealed
41  {
42  private:
43  TypeTranslator::TypeTranslator() {}
44 
45  public:
46  // The given object is a managed Dictionary.
47  // Add its elements to the qpid map.
48  static void ManagedToNative(QpidMap ^ theDictionary,
49  ::qpid::types::Variant::Map & qpidMap);
50 
51  // The given object is a managed List.
52  // Add its elements to the qpid list.
53  static void ManagedToNative(QpidList ^ theList,
54  ::qpid::types::Variant::List & qpidList);
55 
56  // The given object is a simple managed type (not a Dictionary or List)
57  // Returns a variant representing simple native type object.
58  static void ManagedToNativeObject(System::Object ^ managedValue,
59  ::qpid::types::Variant & qpidVariant);
60 
61  // The given object is a qpid map.
62  // Add its elements to the managed Dictionary.
63  static void NativeToManaged(::qpid::types::Variant::Map & qpidMap,
64  QpidMap ^ dict);
65 
66  // The given object is a qpid list.
67  // Add its elements to the managed List.
68  static void NativeToManaged(::qpid::types::Variant::List & qpidList,
69  QpidList ^ managedList);
70  };
71 }}}}