cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsStateArrayBase.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 
6  Author(s): Ankur Kapoor
7  Created on: 2004-04-30
8 
9  (C) Copyright 2004-2008 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 */
20 
21 
27 #ifndef _mtsStateArrayBase_h
28 #define _mtsStateArrayBase_h
29 
31 
43 protected:
45  inline mtsStateArrayBase(void){};
46 
49 
50 public:
51  typedef size_t index_type;
52  typedef size_t size_type;
53 
55  inline virtual ~mtsStateArrayBase(void) {};
56 
58  virtual mtsGenericObject & operator[](index_type index) = 0;
59 
61  virtual const mtsGenericObject & operator[](index_type index) const = 0;
62 
64  virtual mtsStateArrayBase * Create(const mtsGenericObject * objectExample, size_type size) = 0;
65 
67  virtual void Copy(index_type indexTo, index_type indexFrom) = 0;
68 
70  virtual bool Get(index_type index, mtsGenericObject & data) const = 0;
71 
73  virtual bool Set(index_type index, const mtsGenericObject & data) = 0;
74 
75  virtual bool SetDataSize(const size_t size) = 0;
76 
77  bool SetSize(const size_t size){
78  return SetDataSize(size);
79  }
80 
81 };
82 
83 
84 #endif // _mtsStateArrayBase_h
85 
virtual void Copy(index_type indexTo, index_type indexFrom)=0
Base class for data object in cisstMultiTask.
Definition: mtsGenericObject.h:56
mtsStateArrayBase(void)
Definition: mtsStateArrayBase.h:45
virtual bool SetDataSize(const size_t size)=0
virtual mtsGenericObject & operator[](index_type index)=0
virtual bool Get(index_type index, mtsGenericObject &data) const =0
virtual mtsStateArrayBase * Create(const mtsGenericObject *objectExample, size_type size)=0
Defines mtsGenericObject.
bool SetSize(const size_t size)
Definition: mtsStateArrayBase.h:77
Base class for class services.
Definition: cmnClassServicesBase.h:45
virtual ~mtsStateArrayBase(void)
Definition: mtsStateArrayBase.h:55
virtual bool Set(index_type index, const mtsGenericObject &data)=0
size_t index_type
Definition: mtsStateArrayBase.h:51
size_t size_type
Definition: mtsStateArrayBase.h:52
Definition: mtsStateArrayBase.h:42
const cmnClassServicesBase * DataClassServices
Definition: mtsStateArrayBase.h:45