PRESTOArchive.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2008 by Paul Demorest
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9#ifndef __PRESTOArchive_h
10#define __PRESTOArchive_h
11
12#include "Pulsar/BasicArchive.h"
13#include "Pulsar/Agent.h"
14
15#include <prepfold.h>
16
17namespace Pulsar {
18
20 class PRESTOArchive : public BasicArchive {
21
22 public:
23
26
28 PRESTOArchive (const PRESTOArchive& archive);
29
32
34 const PRESTOArchive& operator = (const PRESTOArchive& archive);
35
37 PRESTOArchive (const Archive& archive);
38
40 void copy (const Archive& archive);
41
43 PRESTOArchive* clone () const;
44
45 protected:
46
48 virtual void load_header (const char* filename);
49
51 virtual Integration*
52 load_Integration (const char* filename, unsigned subint);
53
55 bool can_unload () const { return false; }
56
58 virtual void unload_file (const char* filename) const;
59
60 // Advocates the use of the PRESTOArchive plugin
61 class Agent;
62
64 friend class Archive::Advocate<PRESTOArchive>;
65
66 private:
67
69 prepfoldinfo pfd;
70
72 int header_size;
73
75 void init ();
76
78 int read_string(char **out, FILE *f);
79
81 void read_position(position *out, FILE *f);
82
84 int test_param_range(std::string &whynot);
85
87 int is_spigot();
88
90 int endian_swap;
91
93 void change_header_endian();
94
96 void change_foldstats_endian(foldstats *f);
97
99 bool polyco_load_failed;
100
101 };
102
103
104 // Advocates the use of the ExampleArchive plugin
105 class PRESTOArchive::Agent : public Archive::Advocate<PRESTOArchive> {
106
107 public:
108
109 Agent () { }
110
112 bool advocate (const char* filename);
113
115 std::string get_name () { return "PRESTO"; }
116
118 std::string get_description ();
119
120 };
121
122}
123
124#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
BasicArchive()
null constructor
Definition BasicArchive.C:18
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
PRESTOArchive * clone() const
Return a new copy-constructed PRESTOArchive instance.
Definition PRESTOArchive.C:83
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition PRESTOArchive.C:60
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition PRESTOArchive.C:357
virtual void unload_file(const char *filename) const
Unload the PRESTOArchive (header and Integration data) to filename.
Definition PRESTOArchive.C:509
PRESTOArchive()
Default constructor.
Definition PRESTOArchive.C:32
virtual void load_header(const char *filename)
Load the PRESTO header information from filename.
Definition PRESTOArchive.C:212
const PRESTOArchive & operator=(const PRESTOArchive &archive)
Assignment operator.
bool can_unload() const
The unload_file method is not implemented.
Definition PRESTOArchive.h:55
~PRESTOArchive()
Destructor.
Definition PRESTOArchive.C:37
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0