remotemono
RMonoAPIBase_Def.h
1 /*
2  Copyright 2020 David "Alemarius Nexus" Lerch
3 
4  This file is part of RemoteMono.
5 
6  RemoteMono is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  RemoteMono is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with RemoteMono. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #pragma once
21 
22 #include "../config.h"
23 
24 #include <list>
25 #include <BlackBone/Process/Process.h>
26 
27 
28 
29 namespace remotemono
30 {
31 
32 
33 class RMonoHandleBackendBase;
34 class RMonoAPIDispatcher;
35 
36 
37 
43 {
44 public:
45  typedef std::list<RMonoHandleBackendBase*> HandleBackendList;
46  typedef typename HandleBackendList::iterator HandleBackendIterator;
47 
48 public:
49  inline virtual ~RMonoAPIBase();
50 
56  inline HandleBackendIterator registerMonoHandleBackend(RMonoHandleBackendBase* backend);
57 
63  inline void unregisterMonoHandleBackend(HandleBackendIterator backendIt);
64 
69  inline size_t getRegisteredHandleCount() const;
70 
76 
80  inline blackbone::Process& getProcess();
81 
85  inline blackbone::ThreadPtr getWorkerThread();
86 
87 protected:
88  inline RMonoAPIBase(blackbone::Process& process);
89 
90 protected:
91  RMonoAPIDispatcher* apid;
92  HandleBackendList registeredHandles;
93 
94  blackbone::Process& process;
95  blackbone::ThreadPtr worker;
96 };
97 
98 
99 }
remotemono::RMonoAPIBase::getAPIDispatcher
RMonoAPIDispatcher * getAPIDispatcher()
Definition: RMonoAPIBase_Impl.h:67
remotemono::RMonoAPIBase
Definition: RMonoAPIBase_Def.h:43
remotemono::RMonoAPIDispatcher
Definition: RMonoAPIDispatcher_Def.h:78
remotemono::RMonoAPIBase::getRegisteredHandleCount
size_t getRegisteredHandleCount() const
Definition: RMonoAPIBase_Impl.h:61
remotemono::RMonoAPIBase::getWorkerThread
blackbone::ThreadPtr getWorkerThread()
Definition: RMonoAPIBase_Impl.h:79
remotemono::RMonoAPIBase::registerMonoHandleBackend
HandleBackendIterator registerMonoHandleBackend(RMonoHandleBackendBase *backend)
Definition: RMonoAPIBase_Impl.h:46
remotemono::RMonoAPIBase::getProcess
blackbone::Process & getProcess()
Definition: RMonoAPIBase_Impl.h:73
remotemono::RMonoHandleBackendBase
Definition: RMonoHandle_Def.h:40
remotemono::RMonoAPIBase::unregisterMonoHandleBackend
void unregisterMonoHandleBackend(HandleBackendIterator backendIt)
Definition: RMonoAPIBase_Impl.h:55