cisst-saw
Loading...
Searching...
No Matches
mtsHistory.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5 $Id: mtsHistory.h 2009-03-02 mjung5
6
7 Author(s): Min Yang Jung
8 Created on: 2009-03-25
9
10 (C) Copyright 2009 Johns Hopkins University (JHU), All Rights
11 Reserved.
12
13--- begin cisst license - do not edit ---
14
15This software is provided "as is" under an open source license, with
16no warranty. The complete license can be found in license.txt and
17http://www.cisst.org/cisst/license.txt.
18
19--- end cisst license ---
20
21*/
22
27
28#error "This file has been deprecated, there is no replacement for the class mtsHistory. adeguet1, 2013/06/24"
29
30#ifndef _mtsHistory_h
31#define _mtsHistory_h
32
35
37
42{
43 friend class mtsHistoryBaseTest;
44
45public:
48 virtual ~mtsHistoryBase() {}
49
51 virtual void SetHistorySize(const int historySize) = 0;
52
53 // Methods to be used by GetHistory() (maybe: [], ...)
54};
55
56template <class _elementType>
58 public vctDynamicVector<_elementType>
59{
60 CMN_DECLARE_SERVICES_EXPORT(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
61
62public:
64 typedef _elementType value_type;
65
68
71
73 typedef typename VectorType::size_type size_type;
74
76 inline mtsHistory(void) : VectorType(0) {}
77
80
82 inline void SetHistorySize(const int historySize) {
83 this->SetSize(historySize);
84 }
85
89 inline ThisType & operator=(const VectorType & data) {
90 VectorType::Assign(data);
91 return *this;
92 }
93
95 inline mtsHistory(const ThisType & otherVector):
96 mtsHistoryBase(otherVector),
97 VectorType(otherVector)
98 {}
99
102 inline ~mtsHistory() {}
103
105 virtual std::string ToString(void) const {
106 std::stringstream outputStream;
107 VectorType::ToStream(outputStream);
108 return outputStream.str();
109 }
110
112 virtual void ToStream(std::ostream & outputStream) const {
113 VectorType::ToStream(outputStream);
114 }
115
117 virtual void ToStreamRaw(std::ostream & outputStream, const char delimiter = ' ',
118 bool headerOnly = false, const std::string & headerPrefix = "") const {
119 mtsGenericObject::ToStreamRaw(outputStream, delimiter, headerOnly, headerPrefix);
120 outputStream << delimiter;
121 VectorType::ToStreamRaw(outputStream, delimiter, headerOnly, headerPrefix);
122 }
123};
124
125// PK: the StateTable GetHistory implementation will require an mtsVector
126// for every parameter type!!
127
128// Following is for a vector of cmnDouble
131
132// Following is for a vector of cmnVector<double>
135
136#endif // _mtsHistory_h
mtsGenericObject(void)
Definition mtsGenericObject.h:77
virtual void ToStreamRaw(std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const
mtsHistoryBase(const mtsHistoryBase &other)
Definition mtsHistory.h:47
friend class mtsHistoryBaseTest
Definition mtsHistory.h:43
virtual void SetHistorySize(const int historySize)=0
virtual ~mtsHistoryBase()
Definition mtsHistory.h:48
mtsHistoryBase()
Definition mtsHistory.h:46
Definition mtsHistory.h:59
mtsHistory(size_type size)
Definition mtsHistory.h:79
mtsHistory(const ThisType &otherVector)
Definition mtsHistory.h:95
~mtsHistory()
Definition mtsHistory.h:102
virtual std::string ToString(void) const
Definition mtsHistory.h:105
void SetHistorySize(const int historySize)
Definition mtsHistory.h:82
virtual void ToStream(std::ostream &outputStream) const
Definition mtsHistory.h:112
vctDynamicVector< value_type > VectorType
Definition mtsHistory.h:70
_elementType value_type
Definition mtsHistory.h:64
mtsHistory< value_type > ThisType
Definition mtsHistory.h:67
VectorType::size_type size_type
Definition mtsHistory.h:73
mtsHistory(void)
Definition mtsHistory.h:76
virtual void ToStreamRaw(std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const
Definition mtsHistory.h:117
ThisType & operator=(const VectorType &data)
Definition mtsHistory.h:89
Definition vctForwardDeclarations.h:131
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
const int CMN_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:328
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
Rules of exporting.
mtsHistory< mtsDouble > mtsDoubleHistory
Definition mtsHistory.h:129
mtsHistory< mtsDoubleVec > mtsDoubleVecHistory
Definition mtsHistory.h:133
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228
void SetSize(size_type rows, size_type cols, bool storageOrder)
Definition vctDynamicMatrix.h:364
Declaration of vctDynamicVector.