FreeNOS
ChannelRegistry.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __LIBIPC_CHANNELREGISTRY_H
19 #define __LIBIPC_CHANNELREGISTRY_H
20 
21 #include <HashTable.h>
22 #include <Types.h>
23 
24 class Channel;
25 
38 {
39  public:
40 
44  enum Result
45  {
51  };
52 
53  public:
54 
59 
63  virtual ~ChannelRegistry();
64 
72  Channel * getConsumer(const ProcessID pid);
73 
81  Channel * getProducer(const ProcessID pid);
82 
89 
96 
105  Result registerConsumer(const ProcessID pid, Channel *channel);
106 
115  Result registerProducer(const ProcessID pid, Channel *channel);
116 
125 
134 
135  private:
136 
139 
142 };
143 
149 #endif /* __LIBIPC_CHANNELREGISTRY_H */
Channel
Unidirectional point-to-point messaging channel.
Definition: Channel.h:34
HashTable< ProcessID, Channel * >
Types.h
HashTable.h
ProcessID
u32 ProcessID
Process Identification Number.
Definition: Types.h:140
ChannelRegistry::m_consumer
HashTable< ProcessID, Channel * > m_consumer
Contains registered consumer channels.
Definition: ChannelRegistry.h:138
ChannelRegistry::NotFound
@ NotFound
Definition: ChannelRegistry.h:50
ChannelRegistry::getConsumer
Channel * getConsumer(const ProcessID pid)
Get one consumer.
Definition: ChannelRegistry.cpp:35
ChannelRegistry::Success
@ Success
Definition: ChannelRegistry.h:46
ChannelRegistry::registerConsumer
Result registerConsumer(const ProcessID pid, Channel *channel)
Register consumer channel.
Definition: ChannelRegistry.cpp:63
ChannelRegistry::InvalidArgument
@ InvalidArgument
Definition: ChannelRegistry.h:47
ChannelRegistry::IOError
@ IOError
Definition: ChannelRegistry.h:49
ChannelRegistry::~ChannelRegistry
virtual ~ChannelRegistry()
Destructor.
Definition: ChannelRegistry.cpp:26
ChannelRegistry::getConsumers
HashTable< ProcessID, Channel * > & getConsumers()
Get all consumers.
Definition: ChannelRegistry.cpp:53
ChannelRegistry::m_producer
HashTable< ProcessID, Channel * > m_producer
Contains registered producer channels.
Definition: ChannelRegistry.h:141
ChannelRegistry::registerProducer
Result registerProducer(const ProcessID pid, Channel *channel)
Register producer channel.
Definition: ChannelRegistry.cpp:71
ChannelRegistry::unregisterProducer
Result unregisterProducer(const ProcessID pid)
Unregister producer channel.
Definition: ChannelRegistry.cpp:91
ChannelRegistry
Registration for Channels.
Definition: ChannelRegistry.h:37
ChannelRegistry::ChannelRegistry
ChannelRegistry()
Constructor.
Definition: ChannelRegistry.cpp:22
ChannelRegistry::getProducer
Channel * getProducer(const ProcessID pid)
Get one producer.
Definition: ChannelRegistry.cpp:44
ChannelRegistry::unregisterConsumer
Result unregisterConsumer(const ProcessID pid)
Unregister consumer channel.
Definition: ChannelRegistry.cpp:79
ChannelRegistry::getProducers
HashTable< ProcessID, Channel * > & getProducers()
Get all producers.
Definition: ChannelRegistry.cpp:58
ChannelRegistry::InvalidSize
@ InvalidSize
Definition: ChannelRegistry.h:48
ChannelRegistry::Result
Result
Result codes.
Definition: ChannelRegistry.h:44