F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
InputPortBase.cpp
Go to the documentation of this file.
1 #include <FpConfig.hpp>
3 #include <Fw/Types/Assert.hpp>
4 #include <cstdio>
5 
6 namespace Fw {
7 
9  PortBase(),
10  m_comp(nullptr),
11  m_portNum(-1) {
12  }
13 
15 
16  }
17 
20 
21  }
22 
24  FW_ASSERT(portNum >= 0,portNum);
25  this->m_portNum = portNum;
26  }
27 
28 #if FW_OBJECT_TO_STRING == 1
29  void InputPortBase::toString(char* buffer, NATIVE_INT_TYPE size) {
30 #if FW_OBJECT_NAMES == 1
31  FW_ASSERT(size > 0);
32  if (snprintf(buffer, size, "InputPort: %s->%s", this->m_objName,
33  this->isConnected() ? this->m_connObj->getObjName() : "None") < 0) {
34  buffer[0] = 0;
35  }
36 #else
37  (void)snprintf(buffer,size,"%s","Unnamed Input port");
38 #endif
39  }
40 #endif
41 
42 
43 }
44 
#define FW_ASSERT(...)
Definition: Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
virtual ~InputPortBase()
NATIVE_INT_TYPE m_portNum
virtual void init()
void setPortNum(NATIVE_INT_TYPE portNum)
virtual void init()
Definition: PortBase.cpp:36
bool isConnected()
Definition: PortBase.cpp:41
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:33