![]() |
|
|||
File indexing completed on 2025-07-05 08:58:09
0001 0002 // Copyright 2007-2025, Jefferson Science Associates, LLC. 0003 // Subject to the terms in the LICENSE file found in the top-level directory. 0004 // Author: David Lawrence 0005 0006 #pragma once 0007 #include <stdint.h> 0008 #include <string> 0009 #include <JANA/JApplication.h> 0010 0011 class JCalibration; 0012 0013 /// This is a base class for all event source generators. JANA implements 0014 /// event sources in a modular way so that new types of sources can be 0015 /// easily added. Typically, this just means different file formats, but 0016 /// an also be networked or shared memory sources. To provide a new 0017 /// source type, a class must inherit from JEventSourceGenerator and 0018 /// implement the three virtual methods it defines: 0019 /// 0020 /// Description: 0021 /// This method should just return a short string that can be used to 0022 /// inform the user what type of source this implements. It is purely 0023 /// informational in that the framework never looks at its contents. 0024 /// 0025 /// CheckOpenable: 0026 /// This method should "peek" at the source to see if it is one that 0027 /// it can open. It should return a value between 0 and 1 inclusive 0028 /// with 0 meaning "cannot open" and 1 meaning "absolutely can open". 0029 /// The check can be as simple as looking at the source name (e.g. 0030 /// does it have a specific suffix) or more involved (e.g. opening 0031 /// the file and checking for a magic header). Note that it should 0032 /// not be assumed that the source represents a file name. It could 0033 /// indicate a URL or how to connect to some other non-file source. 0034 /// 0035 /// MakeJEventSource: 0036 /// This will be called when the value of CheckOpenable returned 0037 /// by this object is larger than that returned by all other 0038 /// JEventSourceGenerator objects. This should simply instantiate 0039 /// an object of the JEventSource based class that does the actual 0040 /// work of reading objects from the source. 0041 0042 class JCalibrationGenerator{ 0043 public: 0044 JCalibrationGenerator(){} 0045 virtual ~JCalibrationGenerator(){} 0046 0047 void SetApplication(JApplication *app) { this->app = app; } 0048 JApplication* GetApplication() { return app; } 0049 0050 virtual const char* Description(void)=0; ///< Get string indicating type of calibration this handles 0051 virtual double CheckOpenable(std::string url, int32_t run, std::string context)=0; ///< Test probability of opening the given calibration 0052 virtual JCalibration* MakeJCalibration(std::string url, int32_t run, std::string context)=0; ///< Instantiate an JCalibration object (subclass) 0053 0054 private: 0055 JApplication *app; 0056 }; 0057 0058
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |