Inviwo  0.9.10.1
Inviwo documentation
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 <inport.h>

+ Inheritance diagram for inviwo::Inport:

Public Member Functions

virtual bool isConnected () const override
 
virtual bool isReady () const override
 
void setOptional (bool optional)
 
bool isOptional () const
 
virtual bool isChanged () const
 
virtual bool canConnectTo (const Port *port) const =0
 
virtual void connectTo (Outport *outport)
 
virtual void disconnectFrom (Outport *outport)
 
virtual bool isConnectedTo (const Outport *outport) const
 
virtual OutportgetConnectedOutport () const
 
virtual const std::vector< Outport * > & getConnectedOutports () const
 
virtual size_t getMaxNumberOfConnections () const =0
 
virtual size_t getNumberOfConnections () const
 
virtual std::vector< const Outport * > getChangedOutports () const
 
virtual void propagateEvent (Event *event, Outport *target=nullptr)
 
template<typename T >
const BaseCallBack * onChange (T *o, void(T::*m)())
 
const BaseCallBack * onChange (std::function< void()> lambda)
 
template<typename T >
const BaseCallBack * onInvalid (T *o, void(T::*m)())
 
const BaseCallBack * onInvalid (std::function< void()> lambda)
 
const BaseCallBack * onConnect (std::function< void()> lambda)
 
const BaseCallBack * onDisconnect (std::function< void()> lambda)
 
void removeOnChange (const BaseCallBack *callback)
 
template<typename T >
void removeOnChange (T *o)
 
void removeOnInvalid (const BaseCallBack *callback)
 
template<typename T >
void removeOnInvalid (T *o)
 
void removeOnConnect (const BaseCallBack *callback)
 
void removeOnDisconnect (const BaseCallBack *callback)
 
- Public Member Functions inherited from inviwo::Port
std::string getIdentifier () const
 
void setIdentifier (const std::string &name)
 
ProcessorgetProcessor () const
 
virtual std::string getClassIdentifier () const =0
 
virtual uvec3 getColorCode () const =0
 
virtual Document getInfo () const =0
 
virtual void serialize (Serializer &s) const override
 
virtual void deserialize (Deserializer &d) override
 

Protected Member Functions

 Inport (std::string identifier="")
 
virtual void invalidate (InvalidationLevel invalidationLevel)
 
virtual void setValid (const Outport *source)
 
void readyUpdate ()
 
virtual void setChanged (bool changed=true, const Outport *source=nullptr)
 
void callOnChangeIfChanged () const
 
- Protected Member Functions inherited from inviwo::Port
 Port (std::string identifier="")
 
void setProcessor (Processor *processor)
 

Protected Attributes

StateCoordinator< bool > isReady_
 
StateCoordinator< bool > isOptional_
 
std::vector< Outport * > connectedOutports_
 
- Protected Attributes inherited from inviwo::Port
std::string identifier_
 
Processorprocessor_
 

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()

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.

◆ isChanged()

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

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

◆ isReady()

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()

template<typename T >
const BaseCallBack * inviwo::Inport::onChange ( T *  o,
void(T::*)()  m 
)

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()

template<typename T >
const BaseCallBack * inviwo::Inport::onInvalid ( T *  o,
void(T::*)()  m 
)

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()

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 ( )
protected

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()

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 files: