Provides protected access to the Profile amplitudes array. More...

#include <ProfileAmps.h>

Inheritance diagram for Pulsar::ProfileAmps:
Pulsar::Container Reference::Able Reference::HeapTracked Pulsar::Profile

Classes

class  Expert
 Provides access to private and protected members of ProfileAmps. More...

Public Member Functions

 ProfileAmps (unsigned nbin=0)
 Constructor initializes the data array.
virtual ~ProfileAmps ()
 Destructor destroys the data array.
 ProfileAmps (const ProfileAmps &)
 Copy constructor.
unsigned get_nbin () const
 Return the number of bins.
virtual void resize (unsigned nbin)
 Resize the data area.
const float * get_amps () const
 Return a pointer to the amplitudes array.
float * get_amps ()
 Return a pointer to the amplitudes array.
template<typename T>
void set_amps (const T *data)
 set the amplitudes array equal to the contents of the data array
template<typename T>
void set_amps (const std::vector< T > &data)
 set the amplitudes array equal to the contents of the data array
template<typename T>
void get_amps (std::vector< T > &data) const
 set the amplitudes array equal to the contents of the data array
void remove (const std::vector< unsigned > &indeces)
 remove the elements specified in the array of indeces
Public Member Functions inherited from Reference::Able
 Able (const Able &)
Ableoperator= (const Able &)
unsigned get_reference_count () const
Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
HeapTrackedoperator= (const HeapTracked &)
bool __is_on_heap () const

Static Public Attributes

static bool no_amps = false
 When true, no memory is allocated for amps.

Friends

class Expert

Additional Inherited Members

Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
static void operator delete (void *location, void *ptr)
static void operator delete (void *location)
static size_t get_heap_queue_size ()
Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
void __dereference (bool auto_delete=true) const

Detailed Description

Provides protected access to the Profile amplitudes array.

By making the amps attribute private, all Profile methods must access the array through the get_amps method.

Member Function Documentation

◆ get_amps()

template<typename T>
void Pulsar::ProfileAmps::get_amps ( std::vector< T > & data) const

set the amplitudes array equal to the contents of the data array

Parameters
datavector of amps

◆ remove()

void Pulsar::ProfileAmps::remove ( const std::vector< unsigned > & indeces)

remove the elements specified in the array of indeces

remove the phase bins specified in the array of indeces

the indeces must be sorted and there must be no repeats

◆ resize()

void Pulsar::ProfileAmps::resize ( unsigned nbin)
virtual

Resize the data area.

Reimplemented in Profile, and Pulsar::Profile.

References no_amps.

Referenced by ProfileAmps(), ProfileAmps(), Pulsar::Profile::resize(), and set_amps().

◆ set_amps() [1/2]

template<typename T>
void Pulsar::ProfileAmps::set_amps ( const std::vector< T > & data)

set the amplitudes array equal to the contents of the data array

Parameters
datavector of amps

References resize().

◆ set_amps() [2/2]

Member Data Documentation

◆ no_amps


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

Generated using doxygen 1.14.0