PVector.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
28 template <typename T>
29 class PAPILLON_API_CORE PVector : public PObject
30 {
31 public:
35  explicit PVector(papillon::int32 n = 0, const T* array = nullptr);
36 
42  PVector(const PVector<T>& other);
43 
47  ~PVector() override;
48 
54  PVector<T>& operator=(const PVector<T>& other);
55 
59  PVector<T> Clone() const;
60 
64  void Reset();
65 
69  void Resize(papillon::int32 n);
70 
74  void Fill(T t);
75 
79  papillon::int32 Size() const;
80 
85  T Get(const papillon::int32 index) const;
86 
91  void Set(const papillon::int32 index, T value);
92 
96  T* GetDataPtr();
97 
101  const T* GetDataPtr() const;
102 };
103 
104 
108 
109 
110 PAPILLON_END_NAMESPACE
PVector< float > PFloatVector
Definition: PVector.h:106
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
PVector< double > PDoubleVector
Definition: PVector.h:107
Class PObject: the root class of all Papillon classes.
PVector< papillon::int32 > PIntVector
Definition: PVector.h:105
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
Dense numeric vector (templated) used for linear algebra; specialised versions are PIntVector...
Definition: PVector.h:29