IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
DecayRange.h
Go to the documentation of this file.
1 /**
2  * \file IMP/bff/DecayRange.h
3  * \brief Defines inspected range of fluorescence decay
4  *
5  * This file defines the DecayRange class, which represents an inspected range
6  * of fluorescence decay. It allows setting and retrieving the start and stop
7  * indices of the range, as well as setting the range using a vector of indices.
8  *
9  * \authors Thomas-Otavio Peulen
10  * \copyright 2007-2023 IMP Inventors. All rights reserved.
11  */
12 
13 #ifndef IMPBFF_DECAYRANGE_H
14 #define IMPBFF_DECAYRANGE_H
15 
16 #include <IMP/bff/bff_config.h>
17 #include <IMP/bff/DecayCurve.h>
18 #include <IMP/Value.h>
19 #include <IMP/value_macros.h>
20 #include <IMP/showable_macros.h>
21 #include <vector>
22 
23 IMPBFF_BEGIN_NAMESPACE
24 
25 /**
26  * \class DecayRange
27  * \brief Represents an inspected range of fluorescence decay
28  *
29  * The DecayRange class represents an inspected range of fluorescence decay.
30  * It allows setting and retrieving the start and stop indices of the range,
31  * as well as setting the range using a vector of indices.
32  */
33 class IMPBFFEXPORT DecayRange : public Value {
34 private:
35  size_t _start = 0; ///< Start index of the decay range
36  size_t _stop = -1; ///< Stop index of the decay range
37 
38 public:
39  /**
40  * \brief Set the start index of the decay range
41  * \param v The start index
42  */
43  void set_start(int v);
44 
45  /**
46  * \brief Get the start index of the decay range
47  * \param d The DecayCurve object (optional)
48  * \return The start index
49  */
50  size_t get_start(DecayCurve* d = nullptr) const;
51 
52  /**
53  * \brief Set the stop index of the decay range
54  * \param v The stop index
55  */
56  void set_stop(int v);
57 
58  /**
59  * \brief Get the stop index of the decay range
60  * \param d The DecayCurve object (optional)
61  * \return The stop index
62  */
63  size_t get_stop(DecayCurve* d = nullptr) const;
64 
65  /**
66  * \brief Set the range using a vector of indices
67  * \param v The vector of indices
68  */
69  void set_range(std::vector<int> v);
70 
71  /**
72  * \brief Get the range as a vector of indices
73  * \param d The DecayCurve object (optional)
74  * \return The vector of indices
75  */
76  std::vector<int> get_range(DecayCurve* d = nullptr);
77 
78  /**
79  * \brief Set the start and stop indices of the decay range
80  * \param start The start index (default: 0)
81  * \param stop The stop index (default: -1)
82  */
83  void set(int start = 0, int stop = -1);
84 
85  /**
86  * \brief Constructor
87  * \param start The start index of the decay range
88  * \param stop The stop index of the decay range
89  */
90  DecayRange(int start, int stop);
91 
92  /**
93  * \brief Destructor
94  */
95  virtual ~DecayRange() = default;
96 
98  { out << "DecayRange"; });
99 };
100 
102 
103 IMPBFF_END_NAMESPACE
104 
105 #endif // IMPBFF_DECAYRANGE_H
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
A more IMP-like version of the std::vector.
Definition: Vector.h:50
Base class for a simple primitive-like type.
Definition: Value.h:23
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Represents an inspected range of fluorescence decay.
Definition: DecayRange.h:33
Class for fluorescence decay curves.
Class for fluorescence decay curves.
Definition: DecayCurve.h:38
Base class for a simple primitive-like type.
Macros to help in implementing Value objects.
Macros to help with objects that can be printed to a stream.