Qpid .NET Messaging API  0.22
TypeTranslator.h
Go to the documentation of this file.
00001 /*
00002 * Licensed to the Apache Software Foundation (ASF) under one
00003 * or more contributor license agreements.  See the NOTICE file
00004 * distributed with this work for additional information
00005 * regarding copyright ownership.  The ASF licenses this file
00006 * to you under the Apache License, Version 2.0 (the
00007 * "License"); you may not use this file except in compliance
00008 * with the License.  You may obtain a copy of the License at
00009 *
00010 *   http://www.apache.org/licenses/LICENSE-2.0
00011 *
00012 * Unless required by applicable law or agreed to in writing,
00013 * software distributed under the License is distributed on an
00014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00015 * KIND, either express or implied.  See the License for the
00016 * specific language governing permissions and limitations
00017 * under the License.
00018 */
00019 #pragma once
00020 
00021 #include <windows.h>
00022 #include <msclr\lock.h>
00023 #include <oletx2xa.h>
00024 #include <string>
00025 #include <limits>
00026 
00027 #include "qpid/types/Variant.h"
00028 
00029 #include "QpidTypeCheck.h"
00030 
00031 namespace Org {
00032 namespace Apache {
00033 namespace Qpid {
00034 namespace Messaging {
00035 
00040     public ref class TypeTranslator sealed
00041     {
00042     private:
00043         TypeTranslator::TypeTranslator() {}
00044 
00045     public:
00046         // The given object is a managed Dictionary.
00047         // Add its elements to the qpid map.
00048         static void ManagedToNative(QpidMap ^ theDictionary,
00049                                     ::qpid::types::Variant::Map & qpidMap);
00050 
00051         // The given object is a managed List.
00052         // Add its elements to the qpid list.
00053         static void ManagedToNative(QpidList ^ theList,
00054                                     ::qpid::types::Variant::List & qpidList);
00055 
00056         // The given object is a simple managed type (not a Dictionary or List)
00057         // Returns a variant representing simple native type object.
00058         static void ManagedToNativeObject(System::Object ^ managedValue,
00059                                           ::qpid::types::Variant & qpidVariant);
00060 
00061         // The given object is a qpid map.
00062         // Add its elements to the managed Dictionary.
00063         static void NativeToManaged(::qpid::types::Variant::Map & qpidMap,
00064                                     QpidMap ^ dict);
00065 
00066         // The given object is a qpid list.
00067         // Add its elements to the managed List.
00068         static void NativeToManaged(::qpid::types::Variant::List & qpidList,
00069                                     QpidList ^ managedList);
00070     };
00071 }}}}