Ask a Question | Search PSRCHIVE: |
Home
|
Pulsar::ManagedStrategies Class Reference Inserted by Integration class to tell Profile instance it is managed. More...
Inheritance diagram for Pulsar::ManagedStrategies:
Detailed DescriptionInserted by Integration class to tell Profile instance it is managed. This class addresses the issue raised by the separation of Base/ and More/ sub-directories. The end goal is to have each Profile use a centralised set of strategies that are managed by the Archive class. This allows things like setting an unique set of strategies for an individual Archive instance, such that all of the Profile instances that it contains behave in a certain way other than the default. For example, when the Archive contains an observation of a noise diode, it can set the baseline and onpulse estimation strategies to algorithms that are specific to square waves. All Profile instances contained by that Archive will then use those strategies. More fundamentally, the problem that this class is attempting to solve is failure to apply the Interface Segregation Principle when designing the Profile class. That is, the Profile class is both a container and a set of algorithms (baseline estimation, signal-to-noise ratio calculation, etc.) that are applied to the contents of the container. In principle, the containerly nature of the Profile class is implemented by methods that are defined in Base/ and the algorithmic nature of the Profile class is implemented by methods that are defined in More/. This allows an end-user program to be compiled that uses only the container and needs to be linked only against the library defined in Base/; within psrchive, psredit is an example of such a program. Now, ProfileWeightFunction and SNRatioEstimator are defined in More/ and therefore an object that is created in Base/ could never create an instance of ProfileWeightFunction or SNRatioEstimator, as this would create a dependence on the library defined in More/. However, it is necessary for the Integration class to inform each of its Profile instances that its strategies are centrally managed. Therefore, this class is just a place-holder. When Profile::get_strategy (defined in More/) is called, this method will check and see that its strategy instance is of type ManagedStrategies. If so, it will set its strategy to the one retrieved from its Integration container via this class. The documentation for this class was generated from the following files:
Generated using doxygen 1.8.17
|