iCub-main
dynContactList.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2011 RobotCub Consortium
3  * Author: Andrea Del Prete
4  * CopyPolicy: Released under the terms of the GNU GPL v2.0.
5  *
6  */
7 
25 #ifndef __DYNCONTLIST_H__
26 #define __DYNCONTLIST_H__
27 
28 #include <vector>
29 #include <yarp/os/Portable.h>
31 
32 namespace iCub
33 {
34 namespace skinDynLib
35 {
36 
42 class dynContactList : public std::vector<dynContact>, public yarp::os::Portable
43 {
44 protected:
45 
46 public:
47  //~~~~~~~~~~~~~~~~~~~~~~
48  // CONSTRUCTORS
49  //~~~~~~~~~~~~~~~~~~~~~~
51  dynContactList(const size_type &n, const dynContact& value = dynContact());
52 
53 
54  //~~~~~~~~~~~~~~~~~~~~~~~~~
55  // SERIALIZATION methods
56  //~~~~~~~~~~~~~~~~~~~~~~~~~
57  /*
58  * Read dynContactList from a connection.
59  * return true iff a dynContactList was read correctly
60  */
61  virtual bool read(yarp::os::ConnectionReader& connection);
62 
67  virtual bool write(yarp::os::ConnectionWriter& connection) const;
68 
69 
73  virtual std::string toString(const int &precision = -1) const;
74 };
75 
76 }
77 
78 }
79 #endif
80 
81 
Class representing a list of external contacts.
virtual std::string toString(const int &precision=-1) const
Useful to print some information.
virtual bool write(yarp::os::ConnectionWriter &connection) const
Write dynContactList to a connection.
virtual bool read(yarp::os::ConnectionReader &connection)
Class representing an external contact acting on a link of the robot body.
Definition: dynContact.h:52
int n
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.