IntegrationManager.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2003 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Base/Classes/Pulsar/IntegrationManager.h
10
11#ifndef __Pulsar_IntegrationManager_h
12#define __Pulsar_IntegrationManager_h
13
14#include "Pulsar/Container.h"
15
16#include <algorithm>
17
18namespace Pulsar {
19
20 class Integration;
21
22 bool temporal_order (const Reference::To<Integration>& A,
23 const Reference::To<Integration>& B);
24
26
29
30 public:
31
33 static unsigned verbose;
34
37
40
43
45 virtual ~IntegrationManager ();
46
48 Integration* get_Integration (unsigned subint);
49
52
55
57 const Integration* get_Integration (unsigned subint) const;
58
60 const Integration* get_last_Integration () const;
61
63 const Integration* get_first_Integration () const;
64
66 virtual Integration* new_Integration (const Integration* copy = 0) = 0;
67
70
72 virtual Integration* load_Integration (unsigned isubint) = 0;
73
75
76 virtual unsigned get_nsubint () const = 0;
77
79 template<class StrictWeakOrdering>
80 void sort (StrictWeakOrdering comp = temporal_order)
81 {
82 load_all ();
83 std::sort (subints.begin(), subints.begin()+get_nsubint(), comp);
84 }
85
87 void shuffle ();
88
90 class Expert;
91
93 Expert* expert ();
94
95 protected:
96
97 friend class TimeSortedOrder;
98 friend class Expert;
99
101
102 virtual void set_nsubint (unsigned num_sub) = 0;
103
105 virtual void _resize (unsigned nsubint, bool instances=true);
106
108 void append (const IntegrationManager* more_subints);
109
111 void manage (IntegrationManager* more_subints);
112
114 void manage (Integration* integration);
115
117 void insert (unsigned isubint, Integration* integration);
118
120 void unmanage (const Integration*);
121
123 void unmanage (unsigned isubint);
124
126 void load_all ();
127
128 private:
129
131
135 std::vector< Reference::To<Integration> > subints;
136
138 Reference::To<Expert> expert_interface;
139
140 };
141
142}
143
144#endif
145
Data storage implementations.
Definition Container.h:19
Expert * expert()
Provide access to the expert interface.
Definition IntegrationManager.C:234
virtual void _resize(unsigned nsubint, bool instances=true)
Resize the Integration vector.
Definition IntegrationManager.C:195
void load_all()
Load all sub-integrations.
Definition IntegrationManager.C:227
static unsigned verbose
A verbosity flag that can be set for debugging purposes.
Definition IntegrationManager.h:33
Integration * get_first_Integration()
Return a pointer to the first Integration.
Definition IntegrationManager.C:70
void insert(unsigned isubint, Integration *integration)
Insert the Integration instance into the specified location.
Definition IntegrationManager.C:130
void sort(StrictWeakOrdering comp=temporal_order)
Sort the Integrations according to the specified order.
Definition IntegrationManager.h:80
virtual Integration * new_Integration(const Integration *copy=0)=0
Construct new Integration instance.
void shuffle()
Randomly rearrange the sub-integrations.
Definition IntegrationManager.C:221
void manage(IntegrationManager *more_subints)
Append use_Integration modifications of Integration objects to self.
Definition IntegrationManager.C:114
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition IntegrationManager.C:42
Integration * get_last_Integration()
Return a pointer to the last Integration.
Definition IntegrationManager.C:76
virtual void set_nsubint(unsigned num_sub)=0
Set the number of sub-integrations.
void append(const IntegrationManager *more_subints)
Append new_Integration copies of Integration objects to self.
Definition IntegrationManager.C:103
virtual Integration * load_Integration(unsigned isubint)=0
Load new Integration instance.
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
virtual Integration * use_Integration(Integration *use)=0
Use the given Integration instance.
virtual ~IntegrationManager()
destructor
Definition IntegrationManager.C:31
IntegrationManager & operator=(const IntegrationManager &archive)
operator =
void unmanage(const Integration *)
Remove the Integration instance.
Definition IntegrationManager.C:159
IntegrationManager()
null constructor
Definition IntegrationManager.C:17
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0