SOFA API  df362ae1
Open source framework for multi-physics simuation
sofa::type::SVector< T > Class Template Reference

#include <SVector.h>

Same as type::vector, + delimitors on serialization. More...

Inheritance diagram for sofa::type::SVector< T >:

Detailed Description

template<class T>
class sofa::type::SVector< T >

Same as type::vector, + delimitors on serialization.

Public Member Functions

 SVector ()
 reference to a value (read-write) More...
 
 SVector (Size n, const T &value)
 Constructor. More...
 
 SVector (int n, const T &value)
 Constructor. More...
 
 SVector (long n, const T &value)
 Constructor. More...
 
 SVector (Size n)
 Constructor. More...
 
 SVector (const Inherit &x)
 Constructor. More...
 
 SVector (Inherit &&v)
 Move constructor. More...
 
SVector< T > & operator= (const Inherit &x)
 Copy operator. More...
 
SVector< T > & operator= (Inherit &&v)
 Move assignment operator. More...
 
 SVector (typename SVector< T >::const_iterator first, typename SVector< T >::const_iterator last)
 Constructor. More...
 
std::ostream & write (std::ostream &os) const
 
std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
std::istream & read (std::istream &in)
 
std::ostream & write (std::ostream &os) const
 
- Public Member Functions inherited from sofa::type::vector< T, type::CPUMemoryManager< T > >
struct SOFA_ATTRIBUTE_DEPRECATED__REBIND () rebind
 
 vector ()
 Basic constructor. More...
 
 vector (Size n, const T &value)
 Constructor. More...
 
 vector (Size n)
 Constructor. More...
 
 vector (const std::vector< T, Alloc > &x)
 Constructor. More...
 
 vector (const std::initializer_list< T > &t)
 Brace initalizer constructor. More...
 
 vector (std::vector< T, Alloc > &&v)
 Move constructor. More...
 
 vector (typename vector< T >::const_iterator first, typename vector< T >::const_iterator last)
 Constructor. More...
 
vectoroperator= (const std::vector< T, Alloc > &x)
 Copy operator. More...
 
vectoroperator= (std::vector< T, Alloc > &&v)
 Move assignment operator. More...
 
reference operator[] (Size n)
 Read/write random access. More...
 
const_reference operator[] (Size n) const
 Read-only random access. More...
 
std::ostream & write (std::ostream &os) const
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 Specialization for writing vectors of unsigned char. More...
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 Specialization for reading vectors of int and unsigned int using "A-B" notation for all integers between A and B. More...
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
void fill (const T &value)
 Sets every element to 'value'. More...
 
void fastResize (Size n)
 

Friends

std::ostream & operator<< (std::ostream &os, const SVector< T > &vec)
 Output stream. More...
 
std::istream & operator>> (std::istream &in, SVector< T > &vec)
 Input stream. More...
 

Constructor details

◆ SVector() [1/8]

template<class T >
sofa::type::SVector< T >::SVector ( )
inline

reference to a value (read-write)

const reference to a value (read only) Basic onstructor

◆ SVector() [2/8]

template<class T >
sofa::type::SVector< T >::SVector ( Size  n,
const T value 
)
inline

Constructor.

◆ SVector() [3/8]

template<class T >
sofa::type::SVector< T >::SVector ( int  n,
const T value 
)
inline

Constructor.

◆ SVector() [4/8]

template<class T >
sofa::type::SVector< T >::SVector ( long  n,
const T value 
)
inline

Constructor.

◆ SVector() [5/8]

template<class T >
sofa::type::SVector< T >::SVector ( Size  n)
inlineexplicit

Constructor.

◆ SVector() [6/8]

template<class T >
sofa::type::SVector< T >::SVector ( const Inherit x)
inline

Constructor.

◆ SVector() [7/8]

template<class T >
sofa::type::SVector< T >::SVector ( Inherit &&  v)
inline

Move constructor.

◆ SVector() [8/8]

template<class T >
sofa::type::SVector< T >::SVector ( typename SVector< T >::const_iterator  first,
typename SVector< T >::const_iterator  last 
)
inline

Constructor.

Function details

◆ operator=() [1/2]

template<class T >
SVector<T>& sofa::type::SVector< T >::operator= ( const Inherit x)
inline

Copy operator.

◆ operator=() [2/2]

template<class T >
SVector<T>& sofa::type::SVector< T >::operator= ( Inherit &&  v)
inline

Move assignment operator.

◆ read() [1/3]

SOFA_TYPE_API std::istream & sofa::type::SVector< std::string >::read ( std::istream &  in)

reading specialization for std::string SVector begins by [, ends by ] and separates elements with , string elements must be delimited by ' or " (like a list of strings in python).

Note this is a quick&dirty implementation and it could be improved

◆ read() [2/3]

template<class T >
std::istream& sofa::type::SVector< T >::read ( std::istream &  in)
inline

◆ read() [3/3]

std::istream & sofa::type::SVector< std::string >::read ( std::istream &  in)

reading specialization for std::string SVector begins by [, ends by ] and separates elements with , string elements must be delimited by ' or " (like a list of strings in python). example: ['string1' , "string 2 ",'etc...' ]

◆ write() [1/3]

template<class T >
std::ostream& sofa::type::SVector< T >::write ( std::ostream &  os) const
inline

◆ write() [2/3]

SOFA_TYPE_API std::ostream & sofa::type::SVector< std::string >::write ( std::ostream &  os) const

◆ write() [3/3]

std::ostream & sofa::type::SVector< std::string >::write ( std::ostream &  os) const

Related details

◆ operator<<

template<class T >
std::ostream& operator<< ( std::ostream &  os,
const SVector< T > &  vec 
)
friend

Output stream.

◆ operator>>

template<class T >
std::istream& operator>> ( std::istream &  in,
SVector< T > &  vec 
)
friend

Input stream.