WebCFace 2.9.0
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
NumVector Class Reference

shared_ptrで管理されているdoubleのvector More...

#include <webcface/common/num_vector.h>

Inheritance diagram for NumVector:
[legend]

Public Member Functions

 NumVector (double v=0)
 
 NumVector (std::vector< double > vec)
 
 operator const std::vector & () const
 
const double & operator[] (std::size_t index) const
 
const double & at (std::size_t index) const
 
const double * data () const
 
const double * begin () const
 
const double * end () const
 
const double * cbegin () const
 
const double * cend () const
 
std::size_t size () const
 
bool operator== (const NumVector &other) const
 
bool operator!= (const NumVector &other) const
 

Protected Attributes

std::shared_ptr< std::vector< double > > data_
 
double first_
 

Detailed Description

shared_ptrで管理されているdoubleのvector

Since
ver2.10
  • 基本的にはvectorと同じだが、shared_ptrで管理されているため、コピーしたら要素は共有される。
  • 要素数が最初から1の場合メモリの動的確保をしない。
  • 要素数0にはならず、その場合要素数1で値が0となる。

Constructor & Destructor Documentation

◆ NumVector() [1/2]

NumVector ( double  v = 0)

◆ NumVector() [2/2]

NumVector ( std::vector< double >  vec)

Member Function Documentation

◆ at()

const double & at ( std::size_t  index) const

◆ begin()

const double * begin ( ) const
inline

◆ cbegin()

const double * cbegin ( ) const
inline

◆ cend()

const double * cend ( ) const
inline

◆ data()

const double * data ( ) const
inline

◆ end()

const double * end ( ) const
inline

◆ operator const std::vector &()

operator const std::vector & ( ) const

参照はこのNumVectorが破棄されるまで有効

◆ operator!=()

bool operator!= ( const NumVector other) const
inline

◆ operator==()

bool operator== ( const NumVector other) const

◆ operator[]()

const double & operator[] ( std::size_t  index) const
inline

◆ size()

std::size_t size ( ) const

Member Data Documentation

◆ data_

std::shared_ptr<std::vector<double> > data_
mutableprotected

◆ first_

double first_
protected

The documentation for this class was generated from the following files: