Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Classes | Public Types | Public Member Functions | List of all members
transport::interface::Portal Class Reference

Classes

class  ConsumerCallback
 
class  ProducerCallback
 

Public Types

using OnContentObjectCallback = std::function< void(core::Interest &, core::ContentObject &)>
 
using OnInterestTimeoutCallback = std::function< void(core::Interest::Ptr &, const core::Name &)>
 

Public Member Functions

 Portal (asio::io_service &io_service)
 
void setConsumerCallback (ConsumerCallback *consumer_callback)
 
void setProducerCallback (ProducerCallback *producer_callback)
 
void connect (bool is_consumer=true)
 
 ~Portal ()
 
bool interestIsPending (const core::Name &name)
 
void sendInterest (core::Interest::Ptr &&interest, OnContentObjectCallback &&on_content_object_callback=UNSET_CALLBACK, OnInterestTimeoutCallback &&on_interest_timeout_callback=UNSET_CALLBACK)
 
void bind (const BindConfig &config)
 
void runEventsLoop ()
 
void runOneEvent ()
 
void sendContentObject (core::ContentObject &content_object)
 
void stopEventsLoop ()
 
void killConnection ()
 
void clear ()
 
asio::io_service & getIoService ()
 
void registerRoute (core::Prefix &prefix)
 

Constructor & Destructor Documentation

◆ ~Portal()

transport::interface::Portal::~Portal ( )

Destructor.

Member Function Documentation

◆ bind()

void transport::interface::Portal::bind ( const BindConfig config)

Register a producer name to the local forwarder and optionally set the content store size in a per-face manner.

Parameters
config- The configuration for the local forwarder binding.

◆ clear()

void transport::interface::Portal::clear ( )

Clear the pending interest hash table.

◆ connect()

void transport::interface::Portal::connect ( bool  is_consumer = true)

Connect the transport to the local hicn forwarder.

Parameters
is_consumer- Boolean specifying if the application on top of portal is a consumer or a producer.

◆ getIoService()

asio::io_service& transport::interface::Portal::getIoService ( )

Get a reference to the io_service object.

◆ interestIsPending()

bool transport::interface::Portal::interestIsPending ( const core::Name name)

Check if there is already a pending interest for a given name.

Parameters
name- The interest name.

◆ killConnection()

void transport::interface::Portal::killConnection ( )

Disconnect the transport from the local forwarder.

◆ registerRoute()

void transport::interface::Portal::registerRoute ( core::Prefix prefix)

Register a route to the local forwarder.

◆ runOneEvent()

void transport::interface::Portal::runOneEvent ( )

Run one event and return.

◆ sendContentObject()

void transport::interface::Portal::sendContentObject ( core::ContentObject content_object)

Send a data packet to the local forwarder. As opposite to sendInterest, the ownership of the content object is not transferred to the portal.

Parameters
content_object- The data packet.

◆ sendInterest()

void transport::interface::Portal::sendInterest ( core::Interest::Ptr &&  interest,
OnContentObjectCallback &&  on_content_object_callback = UNSET_CALLBACK,
OnInterestTimeoutCallback &&  on_interest_timeout_callback = UNSET_CALLBACK 
)

Send an interest through to the local forwarder.

Parameters
interest- The pointer to the interest. The ownership of the interest is transferred by the caller to portal.
on_content_object_callback- If the caller wishes to use a different callback to be called for this interest, it can set this parameter. Otherwise ConsumerCallback::onContentObject will be used.
on_interest_timeout_callback- If the caller wishes to use a different callback to be called for this interest, it can set this parameter. Otherwise ConsumerCallback::onTimeout will be used.

◆ setConsumerCallback()

void transport::interface::Portal::setConsumerCallback ( ConsumerCallback consumer_callback)

Set the consumer callback.

Parameters
consumer_callback- The pointer to the ConsumerCallback object.

◆ setProducerCallback()

void transport::interface::Portal::setProducerCallback ( ProducerCallback producer_callback)

Set the producer callback.

Parameters
producer_callback- The pointer to the ProducerCallback object.

◆ stopEventsLoop()

void transport::interface::Portal::stopEventsLoop ( )

Stop the event loop, canceling all the pending events in the event queue.

Beware that stopping the event loop DOES NOT disconnect the transport from the local forwarder, the connector underneath will stay connected.


The documentation for this class was generated from the following file: