corba_utility.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00010 /*
00011   AUTHOR(S): Darryl Kang (dk)
00012 
00013   RCS information
00014    $Name: OSB_060808 $
00015    $Revision: 1.39 $
00016 
00017   License
00018    OSB rating and billing library for communication networks
00019    Copyright (C) 2004, 2005, 2006  OSB systems
00020 
00021    This file may be distributed and/or modify under the terms of the
00022    GNU General Public License (GPL) as published by the Free Software
00023    Foundation which is provided in the file LICENSE.GPL included in the
00024    packaging of this file.
00025 
00026    The file is distributed in the hope that it will be useful, but WITHOUT
00027    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00028    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00029    for more details.
00030 
00031    Holders of a OSB Commercial License may use this file under the terms
00032    and conditions of this commercial license.
00033  */
00034 #ifndef _CORBA_UTILITY_H_
00035 #define _CORBA_UTILITY_H_
00036 
00037 // *********************************************************************
00038 // included header files
00039 // + standard includes
00040 #include <vector>
00041 
00042 // + libraries
00043 #include "tao/PortableServer/PortableServer.h"
00044 
00045 #include "chrono.h"
00046 #include "osbid.h"
00047 
00048 // + local headers
00049 #include "corba_utilityC.h"
00050 #include "exceptionC.h"
00051 
00052 // + class declarations
00053 namespace OSB_LIB {
00054     class OsbError;
00055     class BaseError;
00056     class OsbErrors;
00057 }
00058 
00059 // ************************************************************************
00060 // namespace extensions
00061 namespace OSB_CORBA {
00062 
00063     using corba::common::Date;
00064     using corba::common::DateTime;
00065     using corba::common::CfgError;
00066     using corba::common::CfgErrorSeq;
00067     using corba::common::CfgStatus;
00068     using corba::common::OsbCorbaException;
00069     using corba::common::Utf8String;
00070 
00072     template<typename T>
00073     PortableServer::ObjectId_var idToObjectId(
00074         const OSB_LIB::Id<T>& id
00075     )
00076     {
00077         return idToObjectId(id.id());
00078     }
00079 
00081     template<typename T>
00082     PortableServer::ObjectId_var idToObjectId(
00083         const OSB_LIB::Id2<T>& id
00084     )
00085     {
00086         return idToObjectId(id.id1, id.id2);
00087     }
00088 
00090     PortableServer::ObjectId_var idToObjectId(
00091         long id1
00092     );
00093 
00095     PortableServer::ObjectId_var idToObjectId(
00096         long id1,
00097         long id2
00098     );
00099 
00101     PortableServer::ObjectId_var idToObjectId(
00102         long id1,
00103         long id2,
00104         long id3
00105     );
00106 
00113     OsbCorbaException osbCorbaException(
00114         const OSB_LIB::BaseError& error
00115     );
00116 
00130     Utf8String * utf8Ptr(
00131         const std::string& src
00132     );
00133 
00146     Utf8String utf8(
00147         const std::string& src
00148     );
00149 
00157     Date libToCorbaDate(
00158         const OSB_LIB::Date& tmpDate
00159     );
00160 
00168     Date libToCorbaDate(
00169         const OSB_LIB::DateTime& tmpDateTime
00170     );
00171 
00179     OSB_LIB::Date corbaToLibDate(
00180         const Date& tmpDate
00181     );
00182 
00190     OSB_LIB::DateTime corbaToLibDateTime(
00191         const Date& tmpDate
00192     );
00193 
00201     OSB_LIB::DateTime corbaToLibDateTime(
00202         const DateTime& tmpDate
00203     );
00204 
00212     DateTime libToCorbaDateTime(
00213         const OSB_LIB::DateTime& tmpDate
00214     );
00215 
00222     CfgError osbToCfgError(
00223         const OSB_LIB::BaseError& error
00224     );
00225 
00232     CfgErrorSeq* osbToCfgError(
00233         const OSB_LIB::OsbErrors& osbErrors
00234     );
00235 
00246     CfgErrorSeq* osbToCfgError(
00247         const std::vector<OSB_LIB::OsbError>& osbErrors
00248     );
00249 
00257     CfgStatus cfgStatus(
00258         const OSB_LIB::CfgStatus status
00259     );
00260 
00262     OSB_LIB::CfgStatus cfgStatus(
00263         const CfgStatus status
00264     );
00265 }
00266 #endif                                  // #ifndef _CORBA_UTILITY_H_

Generated on Sat Sep 2 14:25:51 2006 for OSB Library by  doxygen 1.4.7