Public Types | Public Member Functions | List of all members
FloatArrayTool Class Referenceabstract

#include <FloatArrayTool.h>

Inheritance diagram for FloatArrayTool:
FclFileFloatArray FclFloatArray

Public Types

using Index = unsigned int
 
using FloatVector = std::vector< float >
 

Public Member Functions

virtual ~FloatArrayTool ()=default
 
virtual Index offset () const
 
virtual std::string label () const
 
virtual std::string unit () const
 
virtual const FloatVectorvalues () const =0
 
virtual Index size () const
 
virtual float defaultValue () const
 
virtual bool inRange (Index ival) const
 
virtual float value (Index ival) const
 
virtual float value (Index ival, float defval) const
 
virtual int fill (FloatVector &vals, float valdef) const
 

Detailed Description

Definition at line 15 of file FloatArrayTool.h.

Member Typedef Documentation

Definition at line 20 of file FloatArrayTool.h.

using FloatArrayTool::Index = unsigned int

Definition at line 19 of file FloatArrayTool.h.

Constructor & Destructor Documentation

virtual FloatArrayTool::~FloatArrayTool ( )
virtualdefault

Member Function Documentation

virtual float FloatArrayTool::defaultValue ( ) const
inlinevirtual

Reimplemented in FclFloatArray, and FclFileFloatArray.

Definition at line 41 of file FloatArrayTool.h.

41 { return 0.0; }
virtual int FloatArrayTool::fill ( FloatVector vals,
float  valdef 
) const
inlinevirtual

Definition at line 66 of file FloatArrayTool.h.

66  {
67  Index len = offset() + size();
68  if ( len > vals.size() ) vals.resize(len, valdef);
69  std::copy(values().begin(), values().end(), vals.begin() + offset());
70  return 0;
71  }
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
unsigned int Index
virtual Index offset() const
virtual Index size() const
T copy(T const &v)
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
virtual const FloatVector & values() const =0
virtual bool FloatArrayTool::inRange ( Index  ival) const
inlinevirtual

Definition at line 44 of file FloatArrayTool.h.

44  {
45  if ( ival < offset() ) return false;
46  if ( ival + offset() >= size() ) return false;
47  return true;
48  }
virtual Index offset() const
virtual Index size() const
virtual std::string FloatArrayTool::label ( ) const
inlinevirtual

Reimplemented in FclFloatArray.

Definition at line 28 of file FloatArrayTool.h.

28 { return ""; }
virtual Index FloatArrayTool::offset ( ) const
inlinevirtual

Reimplemented in FclFloatArray.

Definition at line 25 of file FloatArrayTool.h.

25 { return 0; }
virtual Index FloatArrayTool::size ( ) const
inlinevirtual

Reimplemented in FclFileFloatArray.

Definition at line 37 of file FloatArrayTool.h.

37 { return values().size(); }
virtual const FloatVector & values() const =0
virtual std::string FloatArrayTool::unit ( ) const
inlinevirtual

Reimplemented in FclFileFloatArray, and FclFloatArray.

Definition at line 31 of file FloatArrayTool.h.

31 { return ""; }
virtual float FloatArrayTool::value ( Index  ival) const
inlinevirtual

Definition at line 51 of file FloatArrayTool.h.

51  {
52  if ( ! inRange(ival) ) return defaultValue();
53  return values()[ival + offset()];
54  }
virtual float defaultValue() const
virtual Index offset() const
virtual bool inRange(Index ival) const
virtual const FloatVector & values() const =0
virtual float FloatArrayTool::value ( Index  ival,
float  defval 
) const
inlinevirtual

Definition at line 55 of file FloatArrayTool.h.

55  {
56  if ( ! inRange(ival) ) return defval;
57  return values()[ival + offset()];
58  }
virtual Index offset() const
virtual bool inRange(Index ival) const
virtual const FloatVector & values() const =0
virtual const FloatVector& FloatArrayTool::values ( ) const
pure virtual

Implemented in FclFloatArray, and FclFileFloatArray.


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