Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::Inport Class Referenceabstract

Abstract base class for all inports An Inport can be connected to an Outport. The approved connection can be determined by the canConnectTo function. More...

#include <inviwo/core/ports/inport.h>

Inheritance diagram for inviwo::Inport:

Public Member Functions

virtual bool canConnectTo (const Port *port) const =0
virtual void connectTo (Outport *outport)
virtual void disconnectFrom (Outport *outport)
virtual const std::vector< const Outport * > & getChangedOutports () const
virtual Outport * getConnectedOutport () const
virtual const std::vector< Outport * > & getConnectedOutports () const
virtual size_t getMaxNumberOfConnections () const =0
virtual size_t getNumberOfConnections () const
virtual bool isChanged () const
virtual bool isConnected () const override
virtual bool isConnectedTo (const Outport *outport) const
bool isOptional () const
virtual bool isReady () const override
const BaseCallBack * onChange (std::function< void()> lambda)
std::shared_ptr< std::function< void()> > onChangeScoped (std::function< void()> lambda)
const BaseCallBack * onConnect (std::function< void()> lambda)
std::shared_ptr< std::function< void()> > onConnectScoped (std::function< void()> lambda)
std::shared_ptr< std::function< void(Outport *)> > onConnectScoped (std::function< void(Outport *)> lambda)
const BaseCallBack * onDisconnect (std::function< void()> lambda)
std::shared_ptr< std::function< void()> > onDisconnectScoped (std::function< void()> lambda)
std::shared_ptr< std::function< void(Outport *)> > onDisconnectScoped (std::function< void(Outport *)> lambda)
const BaseCallBack * onInvalid (std::function< void()> lambda)
std::shared_ptr< std::function< void()> > onInvalidScoped (std::function< void()> lambda)
virtual void propagateEvent (Event *event, Outport *target=nullptr)
void readyUpdate ()
void removeOnChange (const BaseCallBack *callback)
void removeOnConnect (const BaseCallBack *callback)
void removeOnDisconnect (const BaseCallBack *callback)
void removeOnInvalid (const BaseCallBack *callback)
void setIsReadyUpdater (std::function< bool()> updater)
void setOptional (bool optional)
Public Member Functions inherited from inviwo::Port
virtual void deserialize (Deserializer &d) override
virtual std::string_view getClassIdentifier () const =0
virtual glm::uvec3 getColorCode () const =0
DocumentgetHelp ()
const DocumentgetHelp () const
const std::string & getIdentifier () const
virtual Document getInfo () const =0
std::string getPath () const
 Get the port path i.e. <processor identifier>.<port identifier>.
void getPath (std::pmr::string &out) const
Processor * getProcessor () const
Port & operator= (const Port &)=delete
Port & operator= (Port &&)=delete
 Port (const Port &)=delete
 Port (Port &&)=delete
virtual void serialize (Serializer &s) const override
Port & setHelp (Document help)
void setIdentifier (const std::string &name)

Protected Member Functions

void callOnChangeIfChanged () const
bool circularConnection (const Port *port) const
 Inport (std::string_view identifier, Document help)
virtual void invalidate (InvalidationLevel invalidationLevel)
virtual void setChanged (bool changed=true, const Outport *source=nullptr)
virtual void setValid (const Outport *source)
Protected Member Functions inherited from inviwo::Port
 Port (std::string_view identifier, Document help)
void setProcessor (Processor *processor)

Static Protected Member Functions

static Document getDefaultPortInfo (const Inport *port, std::string_view portname)

Protected Attributes

std::vector< Outport * > connectedOutports_
StateCoordinator< bool > isOptional_
StateCoordinator< bool > isReady_
Protected Attributes inherited from inviwo::Port
Document help_
std::string identifier_
Processor * processor_

Friends

class Outport
class Processor
class ProcessorNetwork
class ProcessorNetworkEvaluator

Detailed Description

Abstract base class for all inports An Inport can be connected to an Outport. The approved connection can be determined by the canConnectTo function.

Member Function Documentation

◆ invalidate()

virtual void inviwo::Inport::invalidate ( InvalidationLevel invalidationLevel)
protectedvirtual

Called by Outport::invalidate on its connected inports, which is call by Processor::invalidate. Will by default invalidate its processor. From above in the network.

Reimplemented in inviwo::BrushingAndLinkingInport.

◆ isChanged()

virtual bool inviwo::Inport::isChanged ( ) const
virtual

An inport is changed when it has new data, and it's processor has not been processed.

◆ isConnected()

virtual bool inviwo::Inport::isConnected ( ) const
overridevirtual

Implements inviwo::Port.

◆ isReady()

virtual bool inviwo::Inport::isReady ( ) const
overridevirtual

An inport is ready when it is connected, and it's outports are ready.

See also
Outport::isReady

Implements inviwo::Port.

◆ onChange()

const BaseCallBack * inviwo::Inport::onChange ( std::function< void()> lambda)

The on change call back is invoked before Processor::process after a port has been connected, disconnected, or has changed its validation level. Note it is only called if process is also going to be called.

◆ onInvalid()

const BaseCallBack * inviwo::Inport::onInvalid ( std::function< void()> lambda)

the onInvalid callback is called directly after the port has been invalidated. It's only called once for each transition from valid to invalid.

◆ propagateEvent()

virtual void inviwo::Inport::propagateEvent ( Event * event,
Outport * target = nullptr )
virtual

Propagate event upwards towards connected outports, if targets is nullptr, propagate the even to all connected outport, otherwise only to target.

◆ readyUpdate()

void inviwo::Inport::readyUpdate ( )

Called by the connected outports to let the inport know that their ready status has changed.

◆ setOptional()

void inviwo::Inport::setOptional ( bool optional)

An inport can be set optional, in which case the processor will by default be ready even if no outport is connected. This means that an optional inport may not have any connected outports when evaluating the ProcessorNetwork, i.e. when Processor::process() is called. Hence one needs to check manually that the port isReady before using it.

See also
isReady

◆ setValid()

virtual void inviwo::Inport::setValid ( const Outport * source)
protectedvirtual

Called by Outport::setValid, which is call by Processor::setValid, which is called after Processor:process. From above in the network.


The documentation for this class was generated from the following file:
  • include/inviwo/core/ports/inport.h