UniSet  2.6.0
ORepHelpers.h
00001 /*
00002  * Copyright (c) 2015 Pavel Vainerman.
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU Lesser General Public License as
00006  * published by the Free Software Foundation, version 2.1.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011  * Lesser General Lesser Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00015  */
00016 // --------------------------------------------------------------------------
00020 // --------------------------------------------------------------------------
00021 #ifndef ORepHelpers_H_
00022 #define ORepHelpers_H_
00023 // --------------------------------------------------------------------------
00024 #include <omniORB4/CORBA.h>
00025 #include <omniORB4/Naming.hh>
00026 #include <string>
00027 #include "Exceptions.h"
00028 // -----------------------------------------------------------------------------------------
00029 namespace uniset
00030 {
00035 namespace ORepHelpers
00036 {
00038 CosNaming::NamingContext_ptr getRootNamingContext( const CORBA::ORB_ptr orb,
00039         const std::string& nsName, int timeOutSec = 2);
00040 
00042 CosNaming::NamingContext_ptr getContext(const std::string& cname, int argc,
00043                                         const char* const* argv, const std::string& nsName)
00044 throw(uniset::ORepFailed);
00045 
00046 CosNaming::NamingContext_ptr getContext(const CORBA::ORB_ptr orb, const std::string& cname,
00047                                         const std::string& nsName)
00048 throw(uniset::ORepFailed);
00049 
00051 const std::string getSectionName(const std::string& fullName, const std::string& brk = "/");
00052 
00054 const std::string getShortName(const std::string& fullName, const std::string& brk = "/");
00055 
00056 
00058 char checkBadSymbols(const std::string& str);
00059 
00061 std::string BadSymbolsToStr();
00062 
00063 }
00064 // -------------------------------------------------------------------------
00065 } // end of uniset namespace
00066 // -----------------------------------------------------------------------------------------
00067 #endif
00068 // -----------------------------------------------------------------------------------------