NuPIC Core
Core algorithms for NuPIC(the Numenta Platform for Intelligent Computing), implemented in C++
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
nta::Output Class Reference

Represents a named output to a Region. More...

#include <Output.hpp>

Public Member Functions

 Output (Region &region, NTA_BasicType type, bool isRegionLevel)
 Constructor. More...
 
 ~Output ()
 Destructor.
 
void setName (const std::string &name)
 Set the name for the output. More...
 
const std::string & getName () const
 Get the name of the output. More...
 
void initialize (size_t size)
 Initialize the Output . More...
 
void addLink (Link *link)
 Add a Link to the Output . More...
 
void removeLink (Link *link)
 Removing an existing link from the output. More...
 
bool hasOutgoingLinks ()
 Tells whether the output has outgoing links. More...
 
const Array & getData () const
 Get the data of the output. More...
 
bool isRegionLevel () const
 Tells whether the output is region level. More...
 
RegiongetRegion () const
 Get the Region that the output belongs to. More...
 
size_t getNodeOutputElementCount () const
 Get the count of node output element. More...
 

Detailed Description

Represents a named output to a Region.

Definition at line 43 of file Output.hpp.

Constructor & Destructor Documentation

nta::Output::Output ( Region region,
NTA_BasicType  type,
bool  isRegionLevel 
)

Constructor.

Parameters
regionThe region that the output belongs to.
typeThe type of the output, TODO
isRegionLevelWhether the output is region level, i.e. TODO

Member Function Documentation

void nta::Output::addLink ( Link link)

Add a Link to the Output .

Note
The Output does NOT take ownership of link, it's created and owned by an Input Object.

Called by Input.addLink()

Parameters
linkThe Link to add
const Array& nta::Output::getData ( ) const

Get the data of the output.

Returns
A constant reference to the data of the output as an Array
Note
It's mportant to return a const array so caller can't reallocate the buffer.
const std::string& nta::Output::getName ( ) const

Get the name of the output.

Returns
The name of the output
size_t nta::Output::getNodeOutputElementCount ( ) const

Get the count of node output element.

Returns
The count of node output element, previously set by initialize().
Region& nta::Output::getRegion ( ) const

Get the Region that the output belongs to.

Returns
The mutable reference to the Region that the output belongs to
bool nta::Output::hasOutgoingLinks ( )

Tells whether the output has outgoing links.

Note
We cannot delete a region if there are any outgoing links This allows us to check in Network.removeRegion() and Network.~Network().
Returns
Whether the output has outgoing links
void nta::Output::initialize ( size_t  size)

Initialize the Output .

Parameters
sizeThe count of node output element, i.e. TODO
Note
It's safe to reinitialize an initialized Output with the same parameters.
bool nta::Output::isRegionLevel ( ) const

Tells whether the output is region level.

Returns
Whether the output is region level, i.e. TODO
void nta::Output::removeLink ( Link link)

Removing an existing link from the output.

Note
Called only by Input.removeLink() even if triggered by Network.removeRegion() while removing the region that contains us.
Parameters
linkThe Link to remove
void nta::Output::setName ( const std::string &  name)

Set the name for the output.

Output need to know their own name for error messages.

Parameters
nameThe name of the output

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