source: XIOS/trunk/src/filter/output_pin.cpp @ 637

Last change on this file since 637 was 637, checked in by rlacroix, 9 years ago

Add the base classes for the new filter framework.

File size: 798 bytes
Line 
1#include "output_pin.hpp"
2#include "exception.hpp"
3
4namespace xios
5{
6  void COutputPin::connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot)
7  {
8    if (!inputPin)
9      ERROR("void COutputPin::connectOutput(CInputPin* inputPin, size_t inputSlot)",
10            "The input pin cannot be null.");
11
12    outputs.push_back(std::make_pair(inputPin, inputSlot));
13  }
14
15  void COutputPin::deliverOuput(CDataPacketPtr packet)
16  {
17    if (!packet)
18      ERROR("void COutputPin::deliverOuput(CDataPacketPtr packet)",
19            "The packet cannot be null.");
20
21    std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd;
22    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it)
23      it->first->setInput(it->second, packet);
24  }
25} // namespace xios
Note: See TracBrowser for help on using the repository browser.