Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
bin
ctaskbrowser.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
tag: Peter Soetens Thu Jul 3 15:30:32 CEST 2008 ctaskbrowser.cpp
3
4
ctaskbrowser.cpp - description
5
-------------------
6
begin : Thu July 03 2008
7
copyright : (C) 2008 Peter Soetens
8
email : peter.soetens@fmtc.be
9
10
***************************************************************************
11
* This program is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU Lesser General Public *
13
* License as published by the Free Software Foundation; either *
14
* version 2.1 of the License, or (at your option) any later version. *
15
* *
16
* This program is distributed in the hope that it will be useful, *
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* Lesser General Public License for more details. *
20
* *
21
* You should have received a copy of the GNU Lesser General Public *
22
* License along with this program; if not, write to the Free Software *
23
* Foundation, Inc., 59 Temple Place, *
24
* Suite 330, Boston, MA 02111-1307 USA *
25
* *
26
***************************************************************************/
27
28
#include <
rtt/os/main.h
>
29
#include <
rtt/plugin/PluginLoader.hpp
>
30
#include <
rtt/transports/corba/TaskContextProxy.hpp
>
31
#include <
rtt/transports/corba/TaskContextServer.hpp
>
32
#include <
taskbrowser/TaskBrowser.hpp
>
33
#include <iostream>
34
#include <string>
35
36
#include "installpath.hpp"
37
38
using namespace
RTT
;
39
using namespace
RTT::corba
;
40
41
#define ORO_xstr(s) ORO_str(s)
42
#define ORO_str(s) #s
43
44
int
ORO_main
(
int
argc,
char
** argv)
45
{
46
47
if
( argc == 2 && strncmp(argv[1],
"--version"
,9) == 0) {
48
std::cout<<
" OROCOS Toolchain version '"
ORO_xstr
(RTT_VERSION)
"'"
;
49
#ifdef __GNUC__
50
std::cout <<
" ( GCC "
ORO_xstr
(__GNUC__)
"."
ORO_xstr
(__GNUC_MINOR__)
"."
ORO_xstr
(__GNUC_PATCHLEVEL__)
" )"
;
51
#endif
52
#ifdef OROPKG_OS_LXRT
53
std::cout<<
" -- LXRT/RTAI."
;
54
#endif
55
#ifdef OROPKG_OS_GNULINUX
56
std::cout<<
" -- GNU/Linux."
;
57
#endif
58
#ifdef OROPKG_OS_XENOMAI
59
std::cout<<
" -- Xenomai."
;
60
#endif
61
std::cout << std::endl;
62
return
0;
63
}
64
65
if
( argc == 1 || (argc == 2 && strncmp(argv[1],
"--help"
,6) == 0)) {
66
std::cerr <<
"Please specify the CORBA TaskContext name or IOR to connect to."
<< std::endl;
67
std::cerr <<
" "
<< argv[0] <<
" [ComponentName | IOR]"
<< std::endl;
68
return
-1;
69
}
70
std::string name = argv[1];
71
72
RTT::plugin::PluginLoader::Instance
()->loadTypekits(ocl_install_path);
73
74
TaskContextServer::InitOrb
( argc, argv);
75
76
TaskContextServer::ThreadOrb
();
77
78
RTT::TaskContext
* proxy;
79
if
( name.substr(0, 4) ==
"IOR:"
) {
80
proxy =
RTT::corba::TaskContextProxy::Create
( name,
true
);
81
}
else
{
82
proxy =
RTT::corba::TaskContextProxy::Create
( name );
// is_ior = true
83
}
84
85
if
(proxy == 0){
86
std::cerr <<
"CORBA system error while looking up "
<< name << std::endl;
87
return
-1;
88
}
89
90
OCL::TaskBrowser
tb( proxy );
91
tb.
loop
();
92
93
TaskContextServer::ShutdownOrb
();
94
TaskContextServer::DestroyOrb
();
95
96
return
0;
97
}
OCL::TaskBrowser::loop
void loop()
Call this method from ORO_main() to process keyboard input and thus startup the TaskBrowser.
Definition:
TaskBrowser.cpp:844
PluginLoader.hpp
OCL::TaskBrowser
This component allows a text client to browse the peers of a peer RTT::TaskContext and execute comman...
Definition:
TaskBrowser.hpp:86
ORO_main
int ORO_main(int argc, char **argv)
Definition:
ctaskbrowser.cpp:44
TaskBrowser.hpp
main.h
RTT::corba::ApplicationServer::InitOrb
static RTT_CORBA_API bool InitOrb(int argc, char *argv[], Seconds orb_timeout=0)
TaskContextProxy.hpp
ORO_xstr
#define ORO_xstr(s)
Definition:
ctaskbrowser.cpp:41
RTT::corba::TaskContextServer::ThreadOrb
static void ThreadOrb()
RTT::corba
RTT::TaskContext
TaskContextServer.hpp
RTT::plugin::PluginLoader::Instance
static boost::shared_ptr< PluginLoader > Instance()
RTT
RTT::corba::TaskContextServer::ShutdownOrb
static void ShutdownOrb(bool wait_for_completion=true)
RTT::corba::TaskContextServer::DestroyOrb
static void DestroyOrb()
RTT::corba::TaskContextProxy::Create
static TaskContextProxy * Create(std::string name, bool is_ior=false)
ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19