ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
TFCS1DFunction_Array< T > Class Template Reference

#include <TFCS1DFunctionTemplateHelpers.h>

Collaboration diagram for TFCS1DFunction_Array< T >:

Public Types

typedef TFCS1DFunction_size_t size_t
 

Public Member Functions

 TFCS1DFunction_Array ()
 
 TFCS1DFunction_Array (size_t count)
 
 ~TFCS1DFunction_Array ()
 
std::size_t MemorySizeArray () const
 
std::size_t MemorySize () const
 
size_t size () const
 
void resize (size_t count)
 resize to given count, copying old content More...
 
T * data ()
 Direct data pointer. More...
 
const T * data () const
 
T & operator[] (size_t pos)
 Direct access operators. More...
 
const T & operator[] (size_t pos) const
 
T * begin ()
 begin() iterators More...
 
const T * begin () const
 
T * end ()
 end() iterators More...
 
const T * end () const
 

Private Attributes

T * m_content {nullptr}
 
size_t m_size {0}
 

Detailed Description

template<typename T>
class TFCS1DFunction_Array< T >

Definition at line 80 of file TFCS1DFunctionTemplateHelpers.h.

Member Typedef Documentation

◆ size_t

template<typename T >
typedef TFCS1DFunction_size_t TFCS1DFunction_Array< T >::size_t

Definition at line 82 of file TFCS1DFunctionTemplateHelpers.h.

Constructor & Destructor Documentation

◆ TFCS1DFunction_Array() [1/2]

template<typename T >
TFCS1DFunction_Array< T >::TFCS1DFunction_Array ( )
inline

Definition at line 84 of file TFCS1DFunctionTemplateHelpers.h.

84 {};

◆ TFCS1DFunction_Array() [2/2]

template<typename T >
TFCS1DFunction_Array< T >::TFCS1DFunction_Array ( size_t  count)
inline

Definition at line 85 of file TFCS1DFunctionTemplateHelpers.h.

85 { resize(count); };

◆ ~TFCS1DFunction_Array()

template<typename T >
TFCS1DFunction_Array< T >::~TFCS1DFunction_Array ( )
inline

Definition at line 86 of file TFCS1DFunctionTemplateHelpers.h.

86  {
87  if (m_content)
88  delete[] m_content;
89  };

Member Function Documentation

◆ begin() [1/2]

template<typename T >
T* TFCS1DFunction_Array< T >::begin ( )
inline

begin() iterators

Definition at line 124 of file TFCS1DFunctionTemplateHelpers.h.

124 { return m_content; };

◆ begin() [2/2]

template<typename T >
const T* TFCS1DFunction_Array< T >::begin ( ) const
inline

Definition at line 125 of file TFCS1DFunctionTemplateHelpers.h.

125 { return m_content; };

◆ data() [1/2]

template<typename T >
T* TFCS1DFunction_Array< T >::data ( )
inline

Direct data pointer.

Definition at line 115 of file TFCS1DFunctionTemplateHelpers.h.

115 { return m_content; };

◆ data() [2/2]

template<typename T >
const T* TFCS1DFunction_Array< T >::data ( ) const
inline

Definition at line 116 of file TFCS1DFunctionTemplateHelpers.h.

116 { return m_content; };

◆ end() [1/2]

template<typename T >
T* TFCS1DFunction_Array< T >::end ( )
inline

end() iterators

Definition at line 128 of file TFCS1DFunctionTemplateHelpers.h.

128 { return m_content + size(); };

◆ end() [2/2]

template<typename T >
const T* TFCS1DFunction_Array< T >::end ( ) const
inline

Definition at line 129 of file TFCS1DFunctionTemplateHelpers.h.

129 { return m_content + size(); };

◆ MemorySize()

template<typename T >
std::size_t TFCS1DFunction_Array< T >::MemorySize ( ) const
inline

Definition at line 92 of file TFCS1DFunctionTemplateHelpers.h.

92 { return sizeof(*this) + MemorySizeArray(); };

◆ MemorySizeArray()

template<typename T >
std::size_t TFCS1DFunction_Array< T >::MemorySizeArray ( ) const
inline

Definition at line 91 of file TFCS1DFunctionTemplateHelpers.h.

91 { return size() * sizeof(T); };

◆ operator[]() [1/2]

template<typename T >
T& TFCS1DFunction_Array< T >::operator[] ( size_t  pos)
inline

Direct access operators.

Values are in the range [0,TFCS1DFunction_Numeric<T>::MaxValue]

Definition at line 120 of file TFCS1DFunctionTemplateHelpers.h.

120 { return m_content[pos]; };

◆ operator[]() [2/2]

template<typename T >
const T& TFCS1DFunction_Array< T >::operator[] ( size_t  pos) const
inline

Definition at line 121 of file TFCS1DFunctionTemplateHelpers.h.

121 { return m_content[pos]; };

◆ resize()

template<typename T >
void TFCS1DFunction_Array< T >::resize ( size_t  count)
inline

resize to given count, copying old content

Definition at line 97 of file TFCS1DFunctionTemplateHelpers.h.

97  {
98  T *new_cont = nullptr;
99  if (count > 0)
100  new_cont = new T[count];
101  if (m_content && new_cont) {
102  size_t ncopy = count;
103  if (size() < ncopy)
104  ncopy = size();
105  ncopy *= sizeof(T);
106  std::memcpy(new_cont, m_content, ncopy);
107  }
108  if (m_content)
109  delete[] m_content;
110  m_size = count;
111  m_content = new_cont;
112  };

◆ size()

template<typename T >
size_t TFCS1DFunction_Array< T >::size ( ) const
inline

Definition at line 94 of file TFCS1DFunctionTemplateHelpers.h.

94 { return m_size; };

Member Data Documentation

◆ m_content

template<typename T >
T* TFCS1DFunction_Array< T >::m_content {nullptr}
private

Definition at line 132 of file TFCS1DFunctionTemplateHelpers.h.

◆ m_size

template<typename T >
size_t TFCS1DFunction_Array< T >::m_size {0}
private

Definition at line 133 of file TFCS1DFunctionTemplateHelpers.h.


The documentation for this class was generated from the following file:
TFCS1DFunction_Array::m_content
T * m_content
Definition: TFCS1DFunctionTemplateHelpers.h:132
TFCS1DFunction_Array::MemorySizeArray
std::size_t MemorySizeArray() const
Definition: TFCS1DFunctionTemplateHelpers.h:91
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TFCS1DFunction_Array::resize
void resize(size_t count)
resize to given count, copying old content
Definition: TFCS1DFunctionTemplateHelpers.h:97
TFCS1DFunction_Array::m_size
size_t m_size
Definition: TFCS1DFunctionTemplateHelpers.h:133
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TFCS1DFunction_Array::size
size_t size() const
Definition: TFCS1DFunctionTemplateHelpers.h:94
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35