ACT-CV - Machine Vision for Cognitive Modeling
ActCvImpl.cpp
Go to the documentation of this file.
1 // -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; coding: iso-8859-1; -*-
2 
3 
4 /*
5 ACT-CV - Machine Vision for Cognitive Modeling
6 Copyright (c) 2008 Marc Halbruegge
7 
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 
27 #if HAVE_ICE
28 
29 #include <iostream>
30 #include <sstream>
31 #include "ActCvImpl.h"
32 
33 using namespace std;
34 using namespace ActCV;
35 
36 IceServer *IceServer::singleInstance = NULL;
37 
38 
39 
40 void IceClient::ConnectTo(const char* name, int port) {
41  communicator = Ice::initialize();
42  ostringstream ostr;
43  ostr << "keyboard:tcp -h " << name
44  << " -p " << port;
45  keyboard = KeyboardPrx::checkedCast(
46  communicator->stringToProxy(ostr.str()));
47 }
48 
49 void IceClient::SendKey(int keyCode) {
50  if (keyboard) {
51  keyboard->PressKey(keyCode);
52  }
53 }
54 
55 
56 
57 
58 
59 #if 0
60 
65 struct IceServerAutoStop {
66  ~IceServerAutoStop() {
67  if (IceServer::singleInstance != NULL) {
68  delete IceServer::singleInstance;
69  IceServer::singleInstance=NULL;
70  }
71  }
72 } iceServerAutoStop;
73 #endif
74 
75 #endif // HAVE_ICE


ACT-CV - Machine Vision for Cognitive Modeling
© 2015 Marc Halbruegge (actcvlibrary@googlemail.com)