Home | History | Annotate | Download | only in pdx

Lines Matching defs:Channel

41   // System message sent when a new client channel is open.
43 // System message sent when a channel is closed.
54 * Base class of service-side per-channel context classes.
56 class Channel : public std::enable_shared_from_this<Channel> {
58 Channel() {}
59 virtual ~Channel() {}
62 * Utility to get a shared_ptr reference from the channel context pointer.
64 static std::shared_ptr<Channel> GetFromMessageInfo(const MessageInfo& info);
187 * Update the channel event bits with the given clear and set masks.
192 * Create a new channel and push it as a file descriptor to the client. See
196 int flags, const std::shared_ptr<Channel>& channel, int* channel_id);
199 * Create a new channel and push it as a file descriptor to the client. See
203 Service* service, int flags, const std::shared_ptr<Channel>& channel,
207 * Check whether the |ref| is a reference to channel to this service.
208 * If the channel reference in question is valid, the Channel object is
209 * returned in |channel| when non-nullptr.
212 * channel_id - id of the channel if the |ref| is a valid reference to
213 * this service's channel.
215 * EOPNOTSUPP - the file descriptor is not a channel or is a channel to
218 * FAULT - |channel_id| or |channel| are non-nullptr and point to invalid
224 std::shared_ptr<Channel>* channel) const;
227 * Overload of CheckChannel() that checks whether the channel reference is for
228 * a channel to the service |service|.
231 std::shared_ptr<Channel>* channel) const;
235 * to types derived from Channel.
239 std::shared_ptr<C>* channel) const {
240 std::shared_ptr<Channel> base_pointer;
242 CheckChannel(ref, channel ? &base_pointer : nullptr);
243 if (channel)
244 *channel = std::static_pointer_cast<C>(base_pointer);
250 std::shared_ptr<C>* channel) const {
251 std::shared_ptr<Channel> base_pointer;
253 CheckChannel(service, ref, channel ? &base_pointer : nullptr);
254 if (channel)
255 *channel = std::static_pointer_cast<C>(base_pointer);
299 * Get/set the Channel object for the channel associated
303 std::shared_ptr<Channel> GetChannel() const;
304 Status<void> SetChannel(const std::shared_ptr<Channel>& channnel);
307 * Get the Channel object for the channel associated with this message,
308 * automatically converted to the desired subclass of Channel.
347 std::weak_ptr<Channel> channel_;
374 * This gives subclasses of Service a convenient hook to create per-channel
375 * context in the form of a Channel subclass.
377 * The Channel instance returned by this is used to set the channel context
378 * pointer for the channel that was just opened.
380 virtual std::shared_ptr<Channel> OnChannelOpen(Message& message);
384 * This give subclasses of Service a convenient hook to clean up per-channel
388 const std::shared_ptr<Channel>& channel);
391 * Set the channel context for the given channel. This keeps a reference to
392 * the Channel object until the channel is closed or another call replaces
396 const std::shared_ptr<Channel>& channel);
399 * Get the channel context for the given channel id. This method should be
406 * Again, if you lookup a channel context object for a service by id in a
410 std::shared_ptr<Channel> GetChannel(int channel_id) const;
415 * deadlocks and race conditions that may occur when operating on the channel
420 * std::shared_ptr<C>, where C is the subclass of Channel used by the service.
436 * Close a channel, signaling the client file object and freeing the channel
437 * id. Once closed, the client side of the channel always returns the error
440 * The internal reference to the Channel instance associated with the channel
441 * is removed, which may result in the Channel object being freed.
448 * Update the event bits for the given channel (given by id), using the
458 * Create a new channel and push it as a file descriptor to the process
461 * sending process may change these later using fcntl()). The internal Channel
462 * instance associated with this channel is set to |channel|, which may be
463 * nullptr. The new channel id allocated for this channel is returned in
466 * On success, returns the remote channel handle for the new channel in the
473 * new channel.
476 Message* message, int flags, const std::shared_ptr<Channel>& channel,
480 * Check whether the |ref| is a reference to a channel to this service.
481 * If the channel reference in question is valid, the Channel object is
482 * returned in |channel| when non-nullptr.
485 * channel_id - id of the channel if the channel reference.
487 * EOPNOTSUPP - the file descriptor is not a channel or is a channel to
490 * FAULT - |channel_id| or |channel| are non-nullptr and point to invalid
496 std::shared_ptr<Channel>* channel) const;
500 * of types derived from Channel.
504 std::shared_ptr<C>* channel) const {
505 std::shared_ptr<Channel> base_pointer;
507 CheckChannel(message, ref, channel ? &base_pointer : nullptr);
508 if (channel)
509 *channel = std::static_pointer_cast<C>(base_pointer);
560 * Iterator type for Channel map iterators.
563 std::unordered_map<int, std::shared_ptr<Channel>>::iterator;
566 * Iterates over the Channel map and performs the action given by |action| on
567 * each channel map item (const ChannelIterator::value_type).
570 * Channel map.
578 * Iterates over the Channel map and performs the action given by |action| on
579 * each channel map item (const ChannelIterator::value_type).
625 std::unordered_map<int, std::shared_ptr<Channel>> channels_;