STIR  6.2.0
InputStreamWithRecordsFromUPENNtxt.h
Go to the documentation of this file.
1 
9 /*
10  Copyright (C) 2020-2022 University of Pennsylvania
11  This file is part of STIR.
12 
13  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
14 
15  See STIR/LICENSE.txt for details
16 */
17 
18 #ifndef __stir_IO_InputStreamWithRecordsFromUPENNtxt_H__
19 #define __stir_IO_InputStreamWithRecordsFromUPENNtxt_H__
20 
23 
24 START_NAMESPACE_STIR
25 
35 class InputStreamWithRecordsFromUPENNtxt : public RegisteredParsingObject<InputStreamWithRecordsFromUPENNtxt,
36  InputStreamWithRecordsFromUPENN,
37  InputStreamWithRecordsFromUPENN>
38 {
39 private:
42  InputStreamWithRecordsFromUPENN>
43  base_type;
44 
45 public:
46  static const char* const registered_name;
47 
48  InputStreamWithRecordsFromUPENNtxt();
49 
50  virtual ~InputStreamWithRecordsFromUPENNtxt() {}
51 
52  virtual inline Succeeded create_output_file(const std::string ofilename);
54  virtual Succeeded set_up();
56  virtual std::string method_info() const;
57 
58  virtual Succeeded get_next_record(CListRecordPENN& record);
59 
61  virtual Succeeded reset();
62 
64 
67  virtual SavedPosition save_get_position();
68 
70  virtual Succeeded set_get_position(const SavedPosition&);
71 
72  inline std::istream& get_stream() { return *this->stream_ptr; }
73 
74  virtual void set_current_record();
75 
76  virtual void set_new_record(const bool& d,
77  const short int& _dt,
78  const unsigned short int& _xa,
79  const unsigned short int& _xb,
80  const unsigned short int& _za,
81  const unsigned short int& _zb,
82  const unsigned short int& _ea,
83  const unsigned short int& _eb);
84 
85 protected:
86  virtual void set_defaults();
87  virtual void initialise_keymap();
88  virtual bool post_processing();
89 
90 private:
91  shared_ptr<std::istream> stream_ptr = nullptr;
92 
93  std::streampos starting_stream_position;
94 
95  std::vector<std::streampos> saved_get_positions;
96 
97  shared_ptr<std::string> line;
98 };
99 
100 END_NAMESPACE_STIR
101 
103 
104 #endif
Class for reading listmode files in text format from the PENNPet Explorer scanner.
Definition: InputStreamWithRecordsFromUPENNtxt.h:35
Implementation of class stir::InputStreamWithRecordsFromUPENNtxt.
Base class for reading listmode files from the PENNPet Explorer scanner.
Definition: InputStreamWithRecordsFromUPENN.h:40
Declaration of class stir::InputStreamWithRecordsFromUPENN.
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declaration of class stir::RegisteredParsingObject.