//////////////////////////////////////////////////////////////////// /// \class RAT::DBMessenger /// /// \brief DB control /// /// \author /// /// REVISION HISTORY:\n /// 24 Feb 2011 : Gabriel Orebi Gann - New command: /rat/db/allowdanger x. /// When set, this allows the user to set DB values that do not /// exist in the default tables. (Otherwise, RAT will now die). /// 15 May 2017 : N Barros - Introduced new commands to manipulate default plane locks /// 23 May 2017 : N Barros - Introduced command to activate airplane mode from the macro /// 19 Oct 2017 : T Kaptanoglu - Add flag to bypass entirely the default plane lock /// /// \details /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_DBMessenger__ #define __RAT_DBMessenger__ #include #include #include #include #include #include #include namespace RAT { class DBMessenger : public G4UImessenger { public: DBMessenger() { Init(DB::Get()); }; DBMessenger(DB* dbToUse) { Init(dbToUse); }; ~DBMessenger(); G4String GetCurrentValue(G4UIcommand * command); void SetNewValue(G4UIcommand * command, G4String newValue); void Server(std::string url); void AllowDanger(std::string allow); protected: void Init(DB* dbToUse); DB *fDb; G4UIcmdWithAString *fLoadCmd; G4UIcommand *fSetCmd; G4UIcmdWithAString *serverCmd; G4UIcommand *fAllowDangerCmd; G4UIcommand *fSetDBEntryPassCmd; G4UIcmdWithAString *fAddTblNoDefaultPlane; G4UIcmdWithAString *fRmTblNoDefaultPlane; G4UIcmdWithABool *fRmAllTblNoDefaultPlane; G4UIcmdWithAString *fSetRATDBTag; G4UIcmdWithABool *fAirplaneMode; }; } // namespace RAT #endif