| [834] | 1 | // -*- C++ -*-
|
|---|
| 2 | // AID-GENERATED
|
|---|
| 3 | // =========================================================================
|
|---|
| 4 | // This class was generated by AID - Abstract Interface Definition
|
|---|
| 5 | // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
|
|---|
| 6 | // =========================================================================
|
|---|
| 7 | #ifndef HEPREP_HEPREPREADER_H
|
|---|
| 8 | #define HEPREP_HEPREPREADER_H 1
|
|---|
| 9 |
|
|---|
| 10 | // Copyright 2002-2004, Freehep.
|
|---|
| 11 |
|
|---|
| 12 | #include <string>
|
|---|
| 13 | #include <vector>
|
|---|
| 14 |
|
|---|
| 15 | namespace HEPREP {
|
|---|
| 16 |
|
|---|
| 17 | class HepRep;
|
|---|
| 18 |
|
|---|
| 19 | /**
|
|---|
| 20 | * HepRepReader interface.
|
|---|
| 21 | *
|
|---|
| 22 | * @author Mark Donszelmann
|
|---|
| 23 | */
|
|---|
| 24 | class HepRepReader {
|
|---|
| 25 |
|
|---|
| 26 | public:
|
|---|
| 27 | /// Destructor.
|
|---|
| 28 | virtual ~HepRepReader() { /* nop */; }
|
|---|
| 29 |
|
|---|
| 30 | /**
|
|---|
| 31 | * Returns a property (if set in the heprep.properties file).
|
|---|
| 32 | *
|
|---|
| 33 | * @param key property name
|
|---|
| 34 | * @param defaultValue value if property not found
|
|---|
| 35 | */
|
|---|
| 36 | virtual std::string getProperty(std::string key, std::string defaultValue) = 0;
|
|---|
| 37 |
|
|---|
| 38 | /**
|
|---|
| 39 | * Closes the reader and its underlying stream.
|
|---|
| 40 | *
|
|---|
| 41 | * @return false in case of a stream problem.
|
|---|
| 42 | */
|
|---|
| 43 | virtual bool close() = 0;
|
|---|
| 44 |
|
|---|
| 45 | /**
|
|---|
| 46 | * Allows random access.
|
|---|
| 47 | *
|
|---|
| 48 | * @return true if this reader provides random access
|
|---|
| 49 | */
|
|---|
| 50 | virtual bool hasRandomAccess() = 0;
|
|---|
| 51 |
|
|---|
| 52 | /**
|
|---|
| 53 | * Reads a HepRep by name (random access only).
|
|---|
| 54 | *
|
|---|
| 55 | * @param name for the heprep to be read.
|
|---|
| 56 | * @return heprep.
|
|---|
| 57 | */
|
|---|
| 58 | virtual HepRep * read(std::string name) = 0;
|
|---|
| 59 |
|
|---|
| 60 | /**
|
|---|
| 61 | * Returns the current entry name (random acces only).
|
|---|
| 62 | *
|
|---|
| 63 | * @return name of the current entry or null if not supported.
|
|---|
| 64 | */
|
|---|
| 65 | virtual std::string entryName() = 0;
|
|---|
| 66 |
|
|---|
| 67 | /**
|
|---|
| 68 | * Returns a list of names of available entries (random rccess only).
|
|---|
| 69 | * Zip files may contain instructions to skip a number of files. These files
|
|---|
| 70 | * will not be included in the entries.
|
|---|
| 71 | *
|
|---|
| 72 | * @return list of entrynames or null if not supported.
|
|---|
| 73 | */
|
|---|
| 74 | virtual std::vector<std::string> entryNames() = 0;
|
|---|
| 75 |
|
|---|
| 76 | /**
|
|---|
| 77 | * Allows for sequential access.
|
|---|
| 78 | *
|
|---|
| 79 | * @return true if sequential access is possible.
|
|---|
| 80 | */
|
|---|
| 81 | virtual bool hasSequentialAccess() = 0;
|
|---|
| 82 |
|
|---|
| 83 | /**
|
|---|
| 84 | * Resets a sequential HepRep reader.
|
|---|
| 85 | *
|
|---|
| 86 | * @return false in case of a stream problem.
|
|---|
| 87 | */
|
|---|
| 88 | virtual bool reset() = 0;
|
|---|
| 89 |
|
|---|
| 90 | /**
|
|---|
| 91 | * Returns the (estimated) number of HepReps in the reader.
|
|---|
| 92 | * Zip files may contain instructions to skip a number of files. These files
|
|---|
| 93 | * will not be included in the estimate.
|
|---|
| 94 | *
|
|---|
| 95 | * @return number of HepReps, or -1 if cannot be calculated.
|
|---|
| 96 | */
|
|---|
| 97 | virtual int size() = 0;
|
|---|
| 98 |
|
|---|
| 99 | /**
|
|---|
| 100 | * Skips a number of HepReps in the reader.
|
|---|
| 101 | * Zip files may contain instructions to skip a number of files. These files
|
|---|
| 102 | * will not be included in the count to be skipped.
|
|---|
| 103 | *
|
|---|
| 104 | * @param n number of HepReps to be skipped.
|
|---|
| 105 | * @return number of HepReps skipped.
|
|---|
| 106 | */
|
|---|
| 107 | virtual int skip(int n) = 0;
|
|---|
| 108 |
|
|---|
| 109 | /**
|
|---|
| 110 | * Is there a next heprep.
|
|---|
| 111 | *
|
|---|
| 112 | * @return true if the next heprep is available.
|
|---|
| 113 | */
|
|---|
| 114 | virtual bool hasNext() = 0;
|
|---|
| 115 |
|
|---|
| 116 | /**
|
|---|
| 117 | * Reads the next HepRep from the Reader.
|
|---|
| 118 | *
|
|---|
| 119 | * @return heprep.
|
|---|
| 120 | */
|
|---|
| 121 | virtual HepRep * next() = 0;
|
|---|
| 122 | }; // class
|
|---|
| 123 | } // namespace HEPREP
|
|---|
| 124 | #endif /* ifndef HEPREP_HEPREPREADER_H */
|
|---|