iCub-main
Loading...
Searching...
No Matches
ThreadTable2.cpp
Go to the documentation of this file.
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3/*
4 * Copyright (C) 2008 The RobotCub Consortium
5 * Author: Lorenzo Natale
6 * website: www.robotcub.org
7 * Permission is granted to copy, distribute, and/or modify this program
8 * under the terms of the GNU General Public License, version 2 or any
9 * later version published by the Free Software Foundation.
10 *
11 * A copy of the license can be found at
12 * http://www.robotcub.org/icub/license/gpl.txt
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 * Public License for more details
18*/
19
20#include "ThreadTable2.h"
21#include "canControlConstants.h"
22
24{
25 ic=0;
26 clear();
27}
28
30{
31 if(ic!=0)
32 ic->destroyBuffer(_replies);
33 ic=0;
34}
35
37{
38 lock();
39 _pending=BUF_SIZE;
40 _replied=0;
41 unlock();
42}
43
44void ThreadTable2::init(yarp::dev::ICanBufferFactory *i)
45{
46 ic=i;
47 _replies=ic->createBuffer(BUF_SIZE);
48}
49
#define BUF_SIZE
void init(yarp::dev::ICanBufferFactory *i)