Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::psbc::Psbc< Handler > Class Template Reference

A class for buffering DmTrials objects. More...

#include <cheetah/psbc/Psbc.h>

Inheritance diagram for ska::cheetah::psbc::Psbc< Handler >:
Inheritance graph
Collaboration diagram for ska::cheetah::psbc::Psbc< Handler >:
Collaboration graph

Public Types

typedef DmTimeType::ValueType DataType
 
typedef DmTrialsType::TimeType Seconds
 

Public Member Functions

 Psbc (Config const &config, Handler &handler)
 Construct a new instance. More...
 
 Psbc (Psbc const &)=delete
 
 Psbc (Psbc &&)=default
 
void operator() (DataType const &)
 add a DmTrials shared pointer to the underlying container
 
bool is_contiguous () const
 Determines if blocks in the buffer are contiguous in time. More...
 

Detailed Description

template<typename Handler>
class ska::cheetah::psbc::Psbc< Handler >

A class for buffering DmTrials objects.

The Psbc class uses DmTimes as a container to store DmTrials shared pointers for being passed to Fdas and Tdas

Definition at line 57 of file Psbc.h.

Constructor & Destructor Documentation

◆ Psbc()

template<typename Handler>
ska::cheetah::psbc::Psbc< Handler >::Psbc ( Config const &  config,
Handler &  handler 
)

Construct a new instance.

Parameters
configThe Psbc configuration
handlerThe pipeline handler for Psbc to call

Definition at line 34 of file Psbc.cpp.

35  : _duration(0 * data::seconds)
36  , _dump_time(config.dump_time())
37  , _data(DmTimeType::make_shared())
38  , _handler(h)
39  , _mutex(std::unique_ptr<std::mutex>(new std::mutex))
40 {
41 }

Member Function Documentation

◆ is_contiguous()

template<typename Handler >
bool ska::cheetah::psbc::Psbc< Handler >::is_contiguous ( ) const

Determines if blocks in the buffer are contiguous in time.

Returns
True if contiguous, False otherwise.

Definition at line 93 of file Psbc.cpp.

94 {
95  auto const& blocks = _data->blocks();
96  auto prev = blocks.cbegin();
97  auto next = std::next(blocks.cbegin(), 1);
98  for (std::size_t idx=0; idx<blocks.size()-1; ++idx)
99  {
100  if (!((*prev)->is_contiguous(**next)))
101  {
102  return false;
103  }
104  ++prev;
105  ++next;
106  }
107  return true;
108 }

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