F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileManagerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileManagerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FileManager component base class
5 // ======================================================================
6 
7 #ifndef Svc_FileManagerComponentAc_HPP
8 #define Svc_FileManagerComponentAc_HPP
9 
10 #include <atomic>
11 
12 #include "Fw/Cmd/CmdPortAc.hpp"
13 #include "Fw/Cmd/CmdRegPortAc.hpp"
15 #include "Fw/Cmd/CmdString.hpp"
17 #include "Fw/Dp/DpContainer.hpp"
18 #include "Fw/Dp/DpGetPortAc.hpp"
19 #include "Fw/Dp/DpSendPortAc.hpp"
20 #include "Fw/FPrimeBasicTypes.hpp"
21 #include "Fw/Log/LogPortAc.hpp"
22 #include "Fw/Log/LogString.hpp"
23 #include "Fw/Log/LogTextPortAc.hpp"
24 #if !FW_DIRECT_PORT_CALLS
26 #endif
27 #if !FW_DIRECT_PORT_CALLS
29 #endif
30 #include "Fw/Time/TimePortAc.hpp"
31 #include "Fw/Tlm/TlmPortAc.hpp"
32 #include "Fw/Tlm/TlmString.hpp"
38 #include "Svc/Ping/PingPortAc.hpp"
42 
43 namespace Svc {
44 
51  {
52 
53  // ----------------------------------------------------------------------
54  // Friend classes
55  // ----------------------------------------------------------------------
56 
58  friend class FileManagerTesterBase;
60  friend class FileManagerTester;
61 
62  protected:
63 
64  // ----------------------------------------------------------------------
65  // Constants
66  // ----------------------------------------------------------------------
67 
69  enum {
71  };
72 
74  enum {
77  };
78 
80  enum {
89  };
90 
92  enum {
94  };
95 
97  enum {
107  };
111 
113  enum {
147  };
148 
150  enum {
153  };
154 
157  return sizeof(FwDpIdType) + sizeof(FwSizeStoreType) + arraySize * sizeof(U8);
158  }
161 
162  protected:
163 
164  // ----------------------------------------------------------------------
165  // Types for data products
166  // ----------------------------------------------------------------------
167 
169  struct ContainerId {
170  enum T : FwDpIdType {
172  };
173  };
174 
179  };
180  };
181 
183  struct RecordId {
184  enum T : FwDpIdType {
187  };
188  };
189 
191  class DpContainer :
192  public Fw::DpContainer
193  {
194 
195  public:
196 
198  DpContainer(
199  FwDpIdType id,
200  const Fw::Buffer& buffer,
201  FwDpIdType baseId
202  );
203 
205  DpContainer();
206 
207  public:
208 
212  const U8* array,
213  FwSizeType size
214  );
215 
220  );
221 
222  FwDpIdType getBaseId() const { return this->m_baseId; }
223 
224  void setBaseId(FwDpIdType baseId) { this->m_baseId = baseId; }
225 
226  private:
227 
229  FwDpIdType m_baseId;
230 
231  };
232 
233  public:
234 
235  // ----------------------------------------------------------------------
236  // Component initialization
237  // ----------------------------------------------------------------------
238 
240  void init(
241  FwSizeType queueDepth,
242  FwEnumStoreType instance = 0
243  );
244 
245 #if !FW_DIRECT_PORT_CALLS
246 
247  public:
248 
249  // ----------------------------------------------------------------------
250  // Getters for special input ports
251  // ----------------------------------------------------------------------
252 
257  FwIndexType portNum
258  );
259 
260 #endif
261 
262 #if !FW_DIRECT_PORT_CALLS
263 
264  public:
265 
266  // ----------------------------------------------------------------------
267  // Getters for typed input ports
268  // ----------------------------------------------------------------------
269 
274  FwIndexType portNum
275  );
276 
281  FwIndexType portNum
282  );
283 
284 #endif
285 
286 #if !FW_DIRECT_PORT_CALLS
287 
288  public:
289 
290  // ----------------------------------------------------------------------
291  // Connect input ports to special output ports
292  // ----------------------------------------------------------------------
293 
294 #if FW_ENABLE_TEXT_LOGGING == 1
295 
297  void set_LogText_OutputPort(
298  FwIndexType portNum,
299  Fw::InputLogTextPort* port
300  );
301 
302 #endif
303 
306  FwIndexType portNum,
307  Fw::InputCmdRegPort* port
308  );
309 
312  FwIndexType portNum,
314  );
315 
318  FwIndexType portNum,
319  Fw::InputLogPort* port
320  );
321 
324  FwIndexType portNum,
325  Fw::InputDpGetPort* port
326  );
327 
330  FwIndexType portNum,
331  Fw::InputDpSendPort* port
332  );
333 
336  FwIndexType portNum,
337  Fw::InputTimePort* port
338  );
339 
342  FwIndexType portNum,
343  Fw::InputTlmPort* port
344  );
345 
346 #endif
347 
348 #if !FW_DIRECT_PORT_CALLS
349 
350  public:
351 
352  // ----------------------------------------------------------------------
353  // Connect typed input ports to typed output ports
354  // ----------------------------------------------------------------------
355 
358  FwIndexType portNum,
359  Svc::InputPingPort* port
360  );
361 
362 #endif
363 
364 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
365 
366  public:
367 
368  // ----------------------------------------------------------------------
369  // Connect serial input ports to special output ports
370  // ----------------------------------------------------------------------
371 
372 #if FW_ENABLE_TEXT_LOGGING == 1
373 
375  void set_LogText_OutputPort(
376  FwIndexType portNum,
377  Fw::InputSerializePort* port
378  );
379 
380 #endif
381 
384  FwIndexType portNum,
385  Fw::InputSerializePort* port
386  );
387 
390  FwIndexType portNum,
391  Fw::InputSerializePort* port
392  );
393 
396  FwIndexType portNum,
397  Fw::InputSerializePort* port
398  );
399 
402  FwIndexType portNum,
403  Fw::InputSerializePort* port
404  );
405 
408  FwIndexType portNum,
409  Fw::InputSerializePort* port
410  );
411 
414  FwIndexType portNum,
415  Fw::InputSerializePort* port
416  );
417 
418 #endif
419 
420 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
421 
422  public:
423 
424  // ----------------------------------------------------------------------
425  // Connect serial input ports to typed output ports
426  // ----------------------------------------------------------------------
427 
430  FwIndexType portNum,
431  Fw::InputSerializePort* port
432  );
433 
434 #endif
435 
436  public:
437 
438  // ----------------------------------------------------------------------
439  // Command registration
440  // ----------------------------------------------------------------------
441 
445  void regCommands();
446 
447  protected:
448 
449  // ----------------------------------------------------------------------
450  // Component construction and destruction
451  // ----------------------------------------------------------------------
452 
455  const char* compName = ""
456  );
457 
459  virtual ~FileManagerComponentBase();
460 
461  protected:
462 
463  // ----------------------------------------------------------------------
464  // Getters for numbers of special input ports
465  // ----------------------------------------------------------------------
466 
471  return NUM_CMDIN_INPUT_PORTS;
472  }
473 
474  protected:
475 
476  // ----------------------------------------------------------------------
477  // Getters for numbers of typed input ports
478  // ----------------------------------------------------------------------
479 
484  return NUM_PINGIN_INPUT_PORTS;
485  }
486 
492  }
493 
494  protected:
495 
496  // ----------------------------------------------------------------------
497  // Getters for numbers of special output ports
498  // ----------------------------------------------------------------------
499 
500 #if FW_ENABLE_TEXT_LOGGING == 1
501 
505  static constexpr FwIndexType getNum_LogText_OutputPorts() {
507  }
508 
509 #endif
510 
516  }
517 
523  }
524 
530  }
531 
537  }
538 
544  }
545 
551  }
552 
558  }
559 
560  protected:
561 
562  // ----------------------------------------------------------------------
563  // Getters for numbers of typed output ports
564  // ----------------------------------------------------------------------
565 
571  }
572 
573  protected:
574 
575  // ----------------------------------------------------------------------
576  // Connection status queries for special output ports
577  // ----------------------------------------------------------------------
578 
579 #if FW_ENABLE_TEXT_LOGGING == 1
580 
584  bool isConnected_LogText_OutputPort(
585  FwIndexType portNum
586  ) const;
587 
588 #endif
589 
594  FwIndexType portNum
595  ) const;
596 
601  FwIndexType portNum
602  ) const;
603 
608  FwIndexType portNum
609  ) const;
610 
615  FwIndexType portNum
616  ) const;
617 
622  FwIndexType portNum
623  ) const;
624 
629  FwIndexType portNum
630  ) const;
631 
636  FwIndexType portNum
637  ) const;
638 
639  protected:
640 
641  // ----------------------------------------------------------------------
642  // Connection status queries for typed output ports
643  // ----------------------------------------------------------------------
644 
649  FwIndexType portNum
650  ) const;
651 
652 #if FW_DIRECT_PORT_CALLS
653  public:
654 #else
655  protected:
656 #endif
657 
658  // ----------------------------------------------------------------------
659  // Port handler base-class functions for special input ports
660  //
661  // Call these functions directly to bypass the corresponding ports
662  // ----------------------------------------------------------------------
663 
665  void cmdIn_handlerBase(
666  FwIndexType portNum,
667  FwOpcodeType opCode,
668  U32 cmdSeq,
669  Fw::CmdArgBuffer& args
670  );
671 
672  protected:
673 
674  // ----------------------------------------------------------------------
675  // Handlers to implement for typed input ports
676  // ----------------------------------------------------------------------
677 
679  virtual void pingIn_handler(
680  FwIndexType portNum,
681  U32 key
682  ) = 0;
683 
685  virtual void schedIn_handler(
686  FwIndexType portNum,
687  U32 context
688  ) = 0;
689 
690 #if FW_DIRECT_PORT_CALLS
691  public:
692 #else
693  protected:
694 #endif
695 
696  // ----------------------------------------------------------------------
697  // Port handler base-class functions for typed input ports
698  //
699  // Call these functions directly to bypass the corresponding ports
700  // ----------------------------------------------------------------------
701 
703  void pingIn_handlerBase(
704  FwIndexType portNum,
705  U32 key
706  );
707 
709  void schedIn_handlerBase(
710  FwIndexType portNum,
711  U32 context
712  );
713 
714  protected:
715 
716  // ----------------------------------------------------------------------
717  // Pre-message hooks for typed async input ports
718  //
719  // Each of these functions is invoked just before processing a message
720  // on the corresponding port. By default, they do nothing. You can
721  // override them to provide specific pre-message behavior.
722  // ----------------------------------------------------------------------
723 
725  virtual void pingIn_preMsgHook(
726  FwIndexType portNum,
727  U32 key
728  );
729 
730  protected:
731 
732  // ----------------------------------------------------------------------
733  // Invocation functions for typed output ports
734  // ----------------------------------------------------------------------
735 
737  void pingOut_out(
738  FwIndexType portNum,
739  U32 key
740  ) const;
741 
742  protected:
743 
744  // ----------------------------------------------------------------------
745  // Hooks for internal ports
746  //
747  // Each of these functions is invoked just before dropping a message
748  // on the corresponding internal port. You should override them to provide
749  // specific drop behavior.
750  // ----------------------------------------------------------------------
751 
753  virtual void schedInInternal_overflowHook() = 0;
754 
755  protected:
756 
757  // ----------------------------------------------------------------------
758  // Internal interface handlers
759  // ----------------------------------------------------------------------
760 
762  virtual void schedInInternal_internalInterfaceHandler() = 0;
763 
764  protected:
765 
766  // ----------------------------------------------------------------------
767  // Internal interface base-class functions
768  // ----------------------------------------------------------------------
769 
772 
773  protected:
774 
775  // ----------------------------------------------------------------------
776  // Command response
777  // ----------------------------------------------------------------------
778 
780  void cmdResponse_out(
781  FwOpcodeType opCode,
782  U32 cmdSeq,
783  Fw::CmdResponse response
784  );
785 
786  protected:
787 
788  // ----------------------------------------------------------------------
789  // Command handlers to implement
790  // ----------------------------------------------------------------------
791 
795  virtual void CreateDirectory_cmdHandler(
796  FwOpcodeType opCode,
797  U32 cmdSeq,
798  const Fw::CmdStringArg& dirName
799  ) = 0;
800 
804  virtual void MoveFile_cmdHandler(
805  FwOpcodeType opCode,
806  U32 cmdSeq,
807  const Fw::CmdStringArg& sourceFileName,
808  const Fw::CmdStringArg& destFileName
809  ) = 0;
810 
814  virtual void RemoveDirectory_cmdHandler(
815  FwOpcodeType opCode,
816  U32 cmdSeq,
817  const Fw::CmdStringArg& dirName
818  ) = 0;
819 
823  virtual void RemoveFile_cmdHandler(
824  FwOpcodeType opCode,
825  U32 cmdSeq,
826  const Fw::CmdStringArg& fileName,
827  bool ignoreErrors
828  ) = 0;
829 
833  virtual void AppendFile_cmdHandler(
834  FwOpcodeType opCode,
835  U32 cmdSeq,
836  const Fw::CmdStringArg& source,
837  const Fw::CmdStringArg& target
838  ) = 0;
839 
843  virtual void FileSize_cmdHandler(
844  FwOpcodeType opCode,
845  U32 cmdSeq,
846  const Fw::CmdStringArg& fileName
847  ) = 0;
848 
852  virtual void ListDirectory_cmdHandler(
853  FwOpcodeType opCode,
854  U32 cmdSeq,
855  const Fw::CmdStringArg& dirName
856  ) = 0;
857 
861  virtual void CalculateCrc_cmdHandler(
862  FwOpcodeType opCode,
863  U32 cmdSeq,
864  const Fw::CmdStringArg& filename
865  ) = 0;
866 
873  virtual void GenerateDp_cmdHandler(
874  FwOpcodeType opCode,
875  U32 cmdSeq,
876  const Fw::CmdStringArg& fileName,
877  U32 chunkSize,
878  U64 beginOffset,
879  U64 endOffset,
880  U32 priority,
882  ) = 0;
883 
884  protected:
885 
886  // ----------------------------------------------------------------------
887  // Command handler base-class functions
888  //
889  // Call these functions directly to bypass the command input port
890  // ----------------------------------------------------------------------
891 
896  FwOpcodeType opCode,
897  U32 cmdSeq,
898  Fw::CmdArgBuffer& args
899  );
900 
905  FwOpcodeType opCode,
906  U32 cmdSeq,
907  Fw::CmdArgBuffer& args
908  );
909 
914  FwOpcodeType opCode,
915  U32 cmdSeq,
916  Fw::CmdArgBuffer& args
917  );
918 
923  FwOpcodeType opCode,
924  U32 cmdSeq,
925  Fw::CmdArgBuffer& args
926  );
927 
932  FwOpcodeType opCode,
933  U32 cmdSeq,
934  Fw::CmdArgBuffer& args
935  );
936 
941  FwOpcodeType opCode,
942  U32 cmdSeq,
943  Fw::CmdArgBuffer& args
944  );
945 
950  FwOpcodeType opCode,
951  U32 cmdSeq,
952  Fw::CmdArgBuffer& args
953  );
954 
959  FwOpcodeType opCode,
960  U32 cmdSeq,
961  Fw::CmdArgBuffer& args
962  );
963 
971  FwOpcodeType opCode,
972  U32 cmdSeq,
973  Fw::CmdArgBuffer& args
974  );
975 
976  protected:
977 
978  // ----------------------------------------------------------------------
979  // Pre-message hooks for async commands
980  //
981  // Each of these functions is invoked just before processing the
982  // corresponding command. By default they do nothing. You can
983  // override them to provide specific pre-command behavior.
984  // ----------------------------------------------------------------------
985 
987  virtual void CreateDirectory_preMsgHook(
988  FwOpcodeType opCode,
989  U32 cmdSeq
990  );
991 
993  virtual void MoveFile_preMsgHook(
994  FwOpcodeType opCode,
995  U32 cmdSeq
996  );
997 
999  virtual void RemoveDirectory_preMsgHook(
1000  FwOpcodeType opCode,
1001  U32 cmdSeq
1002  );
1003 
1005  virtual void RemoveFile_preMsgHook(
1006  FwOpcodeType opCode,
1007  U32 cmdSeq
1008  );
1009 
1011  virtual void AppendFile_preMsgHook(
1012  FwOpcodeType opCode,
1013  U32 cmdSeq
1014  );
1015 
1017  virtual void FileSize_preMsgHook(
1018  FwOpcodeType opCode,
1019  U32 cmdSeq
1020  );
1021 
1023  virtual void ListDirectory_preMsgHook(
1024  FwOpcodeType opCode,
1025  U32 cmdSeq
1026  );
1027 
1029  virtual void CalculateCrc_preMsgHook(
1030  FwOpcodeType opCode,
1031  U32 cmdSeq
1032  );
1033 
1035  virtual void GenerateDp_preMsgHook(
1036  FwOpcodeType opCode,
1037  U32 cmdSeq
1038  );
1039 
1040  protected:
1041 
1042  // ----------------------------------------------------------------------
1043  // Event logging functions
1044  // ----------------------------------------------------------------------
1045 
1050  const Fw::StringBase& dirName,
1051  U32 status
1052  ) const;
1053 
1058  const Fw::StringBase& dirName,
1059  U32 status
1060  ) const;
1061 
1066  const Fw::StringBase& sourceFileName,
1067  const Fw::StringBase& destFileName,
1068  U32 status
1069  ) const;
1070 
1075  const Fw::StringBase& fileName,
1076  U32 status
1077  ) const;
1078 
1083  const Fw::StringBase& source,
1084  const Fw::StringBase& target,
1085  U32 status
1086  ) const;
1087 
1092  const Fw::StringBase& source,
1093  const Fw::StringBase& target
1094  ) const;
1095 
1100  const Fw::StringBase& dirName
1101  ) const;
1102 
1107  const Fw::StringBase& dirName
1108  ) const;
1109 
1114  const Fw::StringBase& sourceFileName,
1115  const Fw::StringBase& destFileName
1116  ) const;
1117 
1122  const Fw::StringBase& fileName
1123  ) const;
1124 
1129  const Fw::StringBase& source,
1130  const Fw::StringBase& target
1131  ) const;
1132 
1137  const Fw::StringBase& dirName
1138  ) const;
1139 
1144  const Fw::StringBase& dirName
1145  ) const;
1146 
1151  const Fw::StringBase& sourceFileName,
1152  const Fw::StringBase& destFileName
1153  ) const;
1154 
1159  const Fw::StringBase& fileName
1160  ) const;
1161 
1166  const Fw::StringBase& fileName,
1167  FwSizeType size
1168  ) const;
1169 
1174  const Fw::StringBase& fileName,
1175  U32 status
1176  ) const;
1177 
1182  const Fw::StringBase& fileName
1183  ) const;
1184 
1189  const Fw::StringBase& dirName
1190  ) const;
1191 
1196  const Fw::StringBase& dirName,
1197  U32 fileCount
1198  ) const;
1199 
1204  const Fw::StringBase& dirName,
1205  U32 status
1206  ) const;
1207 
1212  const Fw::StringBase& dirName,
1213  const Fw::StringBase& fileName,
1214  FwSizeType fileSize
1215  ) const;
1216 
1221  const Fw::StringBase& dirName,
1222  const Fw::StringBase& subdirName
1223  ) const;
1224 
1229  const Fw::StringBase& fileName
1230  ) const;
1231 
1236  const Fw::StringBase& fileName,
1237  U32 status
1238  ) const;
1239 
1244  const Fw::StringBase& fileName,
1245  U32 crc
1246  ) const;
1247 
1252  const Fw::StringBase& fileName,
1253  const Fw::StringFormatStatus& status
1254  ) const;
1255 
1260  const Fw::StringBase& fileName,
1261  U64 bytesToWrite
1262  ) const;
1263 
1268  const Fw::StringBase& fileName,
1269  U32 chunks
1270  ) const;
1271 
1276  const Fw::StringBase& fileName,
1277  const Svc::FileManager_GenerateDpStage& stage,
1278  U32 status
1279  ) const;
1280 
1285  const Fw::StringBase& fileName
1286  ) const;
1287 
1292  const Fw::StringBase& fileName,
1293  U64 beginOffset,
1294  U64 endOffset,
1295  U64 fileSize
1296  ) const;
1297 
1302  const Fw::StringBase& path,
1303  const Fw::StringBase& sandboxDir
1304  ) const;
1305 
1306  protected:
1307 
1308  // ----------------------------------------------------------------------
1309  // Telemetry serialized write
1310  // ----------------------------------------------------------------------
1311 
1316  void tlmWrite(
1317  FwChanIdType id,
1318  Fw::TlmBuffer& _tlmBuff,
1319  Fw::Time _tlmTime = Fw::Time()
1320  ) const;
1321 
1322  protected:
1323 
1324  // ----------------------------------------------------------------------
1325  // Telemetry write functions
1326  // ----------------------------------------------------------------------
1327 
1332  U32 arg,
1333  Fw::Time _tlmTime = Fw::Time()
1334  ) const;
1335 
1339  void tlmWrite_Errors(
1340  U32 arg,
1341  Fw::Time _tlmTime = Fw::Time()
1342  ) const;
1343 
1344  protected:
1345 
1346  // ----------------------------------------------------------------------
1347  // Functions for managing data products
1348  // ----------------------------------------------------------------------
1349 
1353  FwSizeType dataSize,
1354  DpContainer& container
1355  ) {
1356  return this->dpGet(
1358  dataSize,
1360  container
1361  );
1362  }
1363 
1365  void dpSend(
1366  DpContainer& container,
1367  Fw::Time timeTag = Fw::ZERO_TIME
1368  );
1369 
1370  protected:
1371 
1372  // ----------------------------------------------------------------------
1373  // Time
1374  // ----------------------------------------------------------------------
1375 
1379  Fw::Time getTime() const;
1380 
1381  private:
1382 
1383  // ----------------------------------------------------------------------
1384  // Message dispatch functions
1385  // ----------------------------------------------------------------------
1386 
1388  virtual MsgDispatchStatus doDispatch();
1389 
1390  private:
1391 
1392  // ----------------------------------------------------------------------
1393  // Calls for messages received on special input ports
1394  // ----------------------------------------------------------------------
1395 
1397  static void m_p_cmdIn_in(
1398  Fw::PassiveComponentBase* callComp,
1399  FwIndexType portNum,
1400  FwOpcodeType opCode,
1401  U32 cmdSeq,
1402  Fw::CmdArgBuffer& args
1403  );
1404 
1405  private:
1406 
1407  // ----------------------------------------------------------------------
1408  // Calls for messages received on typed input ports
1409  // ----------------------------------------------------------------------
1410 
1412  static void m_p_pingIn_in(
1413  Fw::PassiveComponentBase* callComp,
1414  FwIndexType portNum,
1415  U32 key
1416  );
1417 
1419  static void m_p_schedIn_in(
1420  Fw::PassiveComponentBase* callComp,
1421  FwIndexType portNum,
1422  U32 context
1423  );
1424 
1425  private:
1426 
1427  // ----------------------------------------------------------------------
1428  // Invocation functions for special output ports
1429  // ----------------------------------------------------------------------
1430 
1431 #if FW_ENABLE_TEXT_LOGGING
1432 
1434  void LogText_out(
1435  FwIndexType portNum,
1436  FwEventIdType id,
1437  Fw::Time& timeTag,
1438  const Fw::LogSeverity& severity,
1439  Fw::TextLogString& text
1440  ) const;
1441 
1442 #endif
1443 
1445  void cmdRegOut_out(
1446  FwIndexType portNum,
1447  FwOpcodeType opCode
1448  ) const;
1449 
1451  void cmdResponseOut_out(
1452  FwIndexType portNum,
1453  FwOpcodeType opCode,
1454  U32 cmdSeq,
1455  const Fw::CmdResponse& response
1456  ) const;
1457 
1459  void eventOut_out(
1460  FwIndexType portNum,
1461  FwEventIdType id,
1462  Fw::Time& timeTag,
1463  const Fw::LogSeverity& severity,
1464  Fw::LogBuffer& args
1465  ) const;
1466 
1468  Fw::Success productGetOut_out(
1469  FwIndexType portNum,
1470  FwDpIdType id,
1471  FwSizeType dataSize,
1472  Fw::Buffer& buffer
1473  ) const;
1474 
1476  void productSendOut_out(
1477  FwIndexType portNum,
1478  FwDpIdType id,
1479  const Fw::Buffer& buffer
1480  ) const;
1481 
1483  void timeCaller_out(
1484  FwIndexType portNum,
1485  Fw::Time& time
1486  ) const;
1487 
1489  void tlmOut_out(
1490  FwIndexType portNum,
1491  FwChanIdType id,
1492  Fw::Time& timeTag,
1493  Fw::TlmBuffer& val
1494  ) const;
1495 
1496  private:
1497 
1498  // ----------------------------------------------------------------------
1499  // Private data product handling functions
1500  // ----------------------------------------------------------------------
1501 
1504  Fw::Success::T dpGet(
1505  ContainerId::T containerId,
1506  FwSizeType dataSize,
1507  FwDpPriorityType priority,
1508  DpContainer& container
1509  );
1510 
1511 #if !FW_DIRECT_PORT_CALLS
1512 
1513  private:
1514 
1515  // ----------------------------------------------------------------------
1516  // Special input ports
1517  // ----------------------------------------------------------------------
1518 
1520  Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS];
1521 
1522 #endif
1523 
1524 #if !FW_DIRECT_PORT_CALLS
1525 
1526  private:
1527 
1528  // ----------------------------------------------------------------------
1529  // Typed input ports
1530  // ----------------------------------------------------------------------
1531 
1533  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
1534 
1536  Svc::InputSchedPort m_schedIn_InputPort[NUM_SCHEDIN_INPUT_PORTS];
1537 
1538 #endif
1539 
1540 #if !FW_DIRECT_PORT_CALLS
1541 
1542  private:
1543 
1544  // ----------------------------------------------------------------------
1545  // Special output ports
1546  // ----------------------------------------------------------------------
1547 
1548 #if FW_ENABLE_TEXT_LOGGING == 1
1549 
1551  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
1552 
1553 #endif
1554 
1556  Fw::OutputCmdRegPort m_cmdRegOut_OutputPort[NUM_CMDREGOUT_OUTPUT_PORTS];
1557 
1559  Fw::OutputCmdResponsePort m_cmdResponseOut_OutputPort[NUM_CMDRESPONSEOUT_OUTPUT_PORTS];
1560 
1562  Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
1563 
1565  Fw::OutputDpGetPort m_productGetOut_OutputPort[NUM_PRODUCTGETOUT_OUTPUT_PORTS];
1566 
1568  Fw::OutputDpSendPort m_productSendOut_OutputPort[NUM_PRODUCTSENDOUT_OUTPUT_PORTS];
1569 
1571  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
1572 
1574  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
1575 
1576 #endif
1577 
1578 #if !FW_DIRECT_PORT_CALLS
1579 
1580  private:
1581 
1582  // ----------------------------------------------------------------------
1583  // Typed output ports
1584  // ----------------------------------------------------------------------
1585 
1587  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
1588 
1589 #endif
1590 
1591  };
1592 
1593 }
1594 
1595 #endif
bool isConnected_productSendOut_OutputPort(FwIndexType portNum) const
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
A data product Container.
Definition: DpContainer.hpp:26
void log_WARNING_HI_ListDirectoryError(const Fw::StringBase &dirName, U32 status) const
void AppendFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_DirectoryListingSubdir(const Fw::StringBase &dirName, const Fw::StringBase &subdirName) const
void log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::StringBase &dirName) const
An error occurred while attempting to create a directory.
static constexpr FwSizeType SIZE_OF_FileChunkDataRecord_RECORD(FwSizeType arraySize)
Record sizes.
FwIdType FwOpcodeType
The type of a command opcode.
Fw::Success::T dpGet_FileDpContainer(FwSizeType dataSize, DpContainer &container)
virtual void ListDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ListDirectory.
void log_ACTIVITY_HI_RemoveDirectorySucceeded(const Fw::StringBase &dirName) const
void log_ACTIVITY_HI_DirectoryListing(const Fw::StringBase &dirName, const Fw::StringBase &fileName, FwSizeType fileSize) const
A command path argument was rejected by the configured sandbox directory.
virtual void MoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName)=0
PlatformSizeType FwSizeType
virtual void MoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command MoveFile.
Invalid offset range requested for data product generation.
U32 FwDpPriorityType
The type of a data product priority.
void log_ACTIVITY_HI_CalculateCrcStarted(const Fw::StringBase &fileName) const
I32 FwEnumStoreType
Metadata for one chunk of a file data product.
virtual void CalculateCrc_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &filename)=0
void log_WARNING_HI_FileSizeError(const Fw::StringBase &fileName, U32 status) const
The File System component deleted an existing file without error.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void log_ACTIVITY_HI_GenerateDpStarted(const Fw::StringBase &fileName, U64 bytesToWrite) const
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void FileSize_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
static constexpr FwIndexType getNum_productGetOut_OutputPorts()
void log_ACTIVITY_HI_FileSizeSucceeded(const Fw::StringBase &fileName, FwSizeType size) const
virtual void RemoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, bool ignoreErrors)=0
void log_ACTIVITY_HI_ListDirectorySucceeded(const Fw::StringBase &dirName, U32 fileCount) const
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
Auto-generated base for FileManager component.
The File System component began creating a new directory.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
bool isConnected_productGetOut_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_CalculateCrcSucceeded(const Fw::StringBase &fileName, U32 crc) const
void CalculateCrc_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
const Time ZERO_TIME
Definition: Time.cpp:5
void log_ACTIVITY_HI_ListDirectoryStarted(const Fw::StringBase &dirName) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_pingOut_OutputPorts()
static constexpr FwIndexType getNum_productSendOut_OutputPorts()
Enum representing a command response.
virtual void RemoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveFile.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
void log_ACTIVITY_HI_MoveFileStarted(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
void log_WARNING_HI_GenerateDpInvalidRange(const Fw::StringBase &fileName, U64 beginOffset, U64 endOffset, U64 fileSize) const
FPP shadow-enum representing Fw::FormatStatus.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
DpContainer()
Constructor with default initialization.
virtual void schedInInternal_internalInterfaceHandler()=0
Internal interface handler for schedInInternal.
static constexpr FwIndexType getNum_eventOut_OutputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
void log_ACTIVITY_HI_AppendFileSucceeded(const Fw::StringBase &source, const Fw::StringBase &target) const
FileManagerComponentBase(const char *compName="")
Construct FileManagerComponentBase object.
void ListDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
The File System component began deleting an existing file.
void init()
Object initializer.
Definition: ObjBase.cpp:24
void log_WARNING_HI_PathOutsideSandbox(const Fw::StringBase &path, const Fw::StringBase &sandboxDir) const
SerializeStatus
forward declaration for string
The File System component moved a file to a new location without error.
void log_WARNING_HI_GenerateDpBufferFailed(const Fw::StringBase &fileName) const
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::StringBase &dirName) const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
FwIdType FwEventIdType
The type of an event identifier.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
void log_WARNING_HI_GenerateDpFailed(const Fw::StringBase &fileName, const Svc::FileManager_GenerateDpStage &stage, U32 status) const
virtual void CreateDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
virtual void ListDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
void RemoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
friend class FileManagerTester
Friend class tester implementation to support white-box testing.
An error occurred while attempting to remove a file.
void log_ACTIVITY_HI_RemoveDirectoryStarted(const Fw::StringBase &dirName) const
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void RemoveDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
The File System component began deleting a directory.
static constexpr FwIndexType getNum_schedIn_InputPorts()
virtual void FileSize_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FileSize.
T
The raw enum type.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
Append 1 file&#39;s contents to the end of another.
The File System component began moving a file to a new location.
void schedInInternal_internalInterfaceInvoke()
Internal interface base-class function for schedInInternal.
virtual void CreateDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CreateDirectory.
FwSizeType FwSizeStoreType
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual void schedInInternal_overflowHook()=0
Overflow hook for async input port schedInInternal.
void log_ACTIVITY_HI_FileSizeStarted(const Fw::StringBase &fileName) const
void log_WARNING_HI_FileNameFormatError(const Fw::StringBase &fileName, const Fw::StringFormatStatus &status) const
Enum representing event severity.
virtual ~FileManagerComponentBase()
Destroy FileManagerComponentBase object.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void MoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Fw::SerializeStatus serializeRecord_FileChunkHeaderRecord(const Svc::FileManager_FileChunkHeader &elt)
void log_ACTIVITY_HI_GenerateDpComplete(const Fw::StringBase &fileName, U32 chunks) const
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
virtual void FileSize_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
void log_ACTIVITY_HI_MoveFileSucceeded(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
static constexpr FwSizeType SIZE_OF_FileChunkHeaderRecord_RECORD
void log_WARNING_HI_DirectoryRemoveError(const Fw::StringBase &dirName, U32 status) const
FwIdType FwDpIdType
The type of a data product identifier.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
void GenerateDp_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_AppendFileStarted(const Fw::StringBase &source, const Fw::StringBase &target) const
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
void tlmWrite_Errors(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void log_ACTIVITY_HI_RemoveFileStarted(const Fw::StringBase &fileName) const
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
virtual void GenerateDp_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, U32 chunkSize, U64 beginOffset, U64 endOffset, U32 priority, const Svc::FileManager_GenerateDpMode &mode)=0
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
How the chunks of a file are emitted.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
PlatformIndexType FwIndexType
The File System component created a new directory without error.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
The File System component deleted and existing directory without error.
Where a data product generation failure occurred.
static constexpr FwIndexType getNum_pingIn_InputPorts()
void log_WARNING_HI_AppendFileFailed(const Fw::StringBase &source, const Fw::StringBase &target, U32 status) const
void regCommands()
Register commands with the Command Dispatcher.
void set_productSendOut_OutputPort(FwIndexType portNum, Fw::InputDpSendPort *port)
Connect port to productSendOut[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()
An error occurred while attempting to remove a directory.
RateGroupDivider component implementation.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void log_WARNING_HI_CalculateCrcFailed(const Fw::StringBase &fileName, U32 status) const
virtual void AppendFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command AppendFile.
Fw::SerializeStatus serializeRecord_FileChunkDataRecord(const U8 *array, FwSizeType size)
virtual void GenerateDp_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GenerateDp.
The File System component appended 2 files without error.
An error occurred while attempting to move a file.
virtual void RemoveDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveDirectory.
The File System component returned status non-zero when trying to append 2 files together.
void log_WARNING_HI_DirectoryCreateError(const Fw::StringBase &dirName, U32 status) const
void set_productGetOut_OutputPort(FwIndexType portNum, Fw::InputDpGetPort *port)
Connect port to productGetOut[portNum].
void log_ACTIVITY_HI_RemoveFileSucceeded(const Fw::StringBase &fileName) const
void log_WARNING_HI_FileMoveError(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName, U32 status) const
void tlmWrite_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void CreateDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Success/Failure.
virtual void RemoveDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
void log_WARNING_HI_FileRemoveError(const Fw::StringBase &fileName, U32 status) const
friend class FileManagerTesterBase
Friend class tester to support autocoded test harness.
void dpSend(DpContainer &container, Fw::Time timeTag=Fw::ZERO_TIME)
Send a data product.
virtual void CalculateCrc_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CalculateCrc.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
The File System component appended 2 files without error.
virtual void AppendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)=0