1 /*GRB* 2 3 Gerbera - https://gerbera.io/ 4 5 context.h - this file is part of Gerbera. 6 7 Copyright (C) 2021 Gerbera Contributors 8 9 Gerbera is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License version 2 11 as published by the Free Software Foundation. 12 13 Gerbera is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with Gerbera. If not, see <http://www.gnu.org/licenses/>. 20 21 $Id$ 22 */ 23 24 /// \file context.h 25 26 #ifndef __CONTEXT_H__ 27 #define __CONTEXT_H__ 28 29 #include <memory> 30 31 // forward declaration 32 class Config; 33 class Clients; 34 class Database; 35 class Mime; 36 class Server; 37 class UpdateManager; 38 namespace Web { 39 class SessionManager; 40 } // namespace Web 41 42 class Context { 43 public: 44 Context(std::shared_ptr<Config> config, 45 std::shared_ptr<Clients> clients, 46 std::shared_ptr<Mime> mime, 47 std::shared_ptr<Database> database, 48 std::shared_ptr<Server> server, 49 std::shared_ptr<Web::SessionManager> session_manager); 50 getConfig()51 std::shared_ptr<Config> getConfig() const 52 { 53 return config; 54 } 55 getClients()56 std::shared_ptr<Clients> getClients() const 57 { 58 return clients; 59 } 60 getMime()61 std::shared_ptr<Mime> getMime() const 62 { 63 return mime; 64 } 65 getDatabase()66 std::shared_ptr<Database> getDatabase() const 67 { 68 return database; 69 } 70 getServer()71 std::shared_ptr<Server> getServer() const 72 { 73 return server; 74 } 75 getSessionManager()76 std::shared_ptr<Web::SessionManager> getSessionManager() const 77 { 78 return session_manager; 79 } 80 81 private: 82 std::shared_ptr<Config> config; 83 std::shared_ptr<Clients> clients; 84 std::shared_ptr<Mime> mime; 85 std::shared_ptr<Database> database; 86 std::shared_ptr<Server> server; 87 std::shared_ptr<Web::SessionManager> session_manager; 88 }; 89 90 #endif // __CONTEXT_H__ 91