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  // Internal interface handlers
746  // ----------------------------------------------------------------------
747 
749  virtual void run_internalInterfaceHandler() = 0;
750 
751  protected:
752 
753  // ----------------------------------------------------------------------
754  // Internal interface base-class functions
755  // ----------------------------------------------------------------------
756 
759 
760  protected:
761 
762  // ----------------------------------------------------------------------
763  // Command response
764  // ----------------------------------------------------------------------
765 
767  void cmdResponse_out(
768  FwOpcodeType opCode,
769  U32 cmdSeq,
770  Fw::CmdResponse response
771  );
772 
773  protected:
774 
775  // ----------------------------------------------------------------------
776  // Command handlers to implement
777  // ----------------------------------------------------------------------
778 
782  virtual void CreateDirectory_cmdHandler(
783  FwOpcodeType opCode,
784  U32 cmdSeq,
785  const Fw::CmdStringArg& dirName
786  ) = 0;
787 
791  virtual void MoveFile_cmdHandler(
792  FwOpcodeType opCode,
793  U32 cmdSeq,
794  const Fw::CmdStringArg& sourceFileName,
795  const Fw::CmdStringArg& destFileName
796  ) = 0;
797 
801  virtual void RemoveDirectory_cmdHandler(
802  FwOpcodeType opCode,
803  U32 cmdSeq,
804  const Fw::CmdStringArg& dirName
805  ) = 0;
806 
810  virtual void RemoveFile_cmdHandler(
811  FwOpcodeType opCode,
812  U32 cmdSeq,
813  const Fw::CmdStringArg& fileName,
814  bool ignoreErrors
815  ) = 0;
816 
820  virtual void AppendFile_cmdHandler(
821  FwOpcodeType opCode,
822  U32 cmdSeq,
823  const Fw::CmdStringArg& source,
824  const Fw::CmdStringArg& target
825  ) = 0;
826 
830  virtual void FileSize_cmdHandler(
831  FwOpcodeType opCode,
832  U32 cmdSeq,
833  const Fw::CmdStringArg& fileName
834  ) = 0;
835 
839  virtual void ListDirectory_cmdHandler(
840  FwOpcodeType opCode,
841  U32 cmdSeq,
842  const Fw::CmdStringArg& dirName
843  ) = 0;
844 
848  virtual void CalculateCrc_cmdHandler(
849  FwOpcodeType opCode,
850  U32 cmdSeq,
851  const Fw::CmdStringArg& filename
852  ) = 0;
853 
860  virtual void GenerateDp_cmdHandler(
861  FwOpcodeType opCode,
862  U32 cmdSeq,
863  const Fw::CmdStringArg& fileName,
864  U32 chunkSize,
865  U64 beginOffset,
866  U64 endOffset,
867  U32 priority,
869  ) = 0;
870 
871  protected:
872 
873  // ----------------------------------------------------------------------
874  // Command handler base-class functions
875  //
876  // Call these functions directly to bypass the command input port
877  // ----------------------------------------------------------------------
878 
883  FwOpcodeType opCode,
884  U32 cmdSeq,
885  Fw::CmdArgBuffer& args
886  );
887 
892  FwOpcodeType opCode,
893  U32 cmdSeq,
894  Fw::CmdArgBuffer& args
895  );
896 
901  FwOpcodeType opCode,
902  U32 cmdSeq,
903  Fw::CmdArgBuffer& args
904  );
905 
910  FwOpcodeType opCode,
911  U32 cmdSeq,
912  Fw::CmdArgBuffer& args
913  );
914 
919  FwOpcodeType opCode,
920  U32 cmdSeq,
921  Fw::CmdArgBuffer& args
922  );
923 
928  FwOpcodeType opCode,
929  U32 cmdSeq,
930  Fw::CmdArgBuffer& args
931  );
932 
937  FwOpcodeType opCode,
938  U32 cmdSeq,
939  Fw::CmdArgBuffer& args
940  );
941 
946  FwOpcodeType opCode,
947  U32 cmdSeq,
948  Fw::CmdArgBuffer& args
949  );
950 
958  FwOpcodeType opCode,
959  U32 cmdSeq,
960  Fw::CmdArgBuffer& args
961  );
962 
963  protected:
964 
965  // ----------------------------------------------------------------------
966  // Pre-message hooks for async commands
967  //
968  // Each of these functions is invoked just before processing the
969  // corresponding command. By default they do nothing. You can
970  // override them to provide specific pre-command behavior.
971  // ----------------------------------------------------------------------
972 
974  virtual void CreateDirectory_preMsgHook(
975  FwOpcodeType opCode,
976  U32 cmdSeq
977  );
978 
980  virtual void MoveFile_preMsgHook(
981  FwOpcodeType opCode,
982  U32 cmdSeq
983  );
984 
986  virtual void RemoveDirectory_preMsgHook(
987  FwOpcodeType opCode,
988  U32 cmdSeq
989  );
990 
992  virtual void RemoveFile_preMsgHook(
993  FwOpcodeType opCode,
994  U32 cmdSeq
995  );
996 
998  virtual void AppendFile_preMsgHook(
999  FwOpcodeType opCode,
1000  U32 cmdSeq
1001  );
1002 
1004  virtual void FileSize_preMsgHook(
1005  FwOpcodeType opCode,
1006  U32 cmdSeq
1007  );
1008 
1010  virtual void ListDirectory_preMsgHook(
1011  FwOpcodeType opCode,
1012  U32 cmdSeq
1013  );
1014 
1016  virtual void CalculateCrc_preMsgHook(
1017  FwOpcodeType opCode,
1018  U32 cmdSeq
1019  );
1020 
1022  virtual void GenerateDp_preMsgHook(
1023  FwOpcodeType opCode,
1024  U32 cmdSeq
1025  );
1026 
1027  protected:
1028 
1029  // ----------------------------------------------------------------------
1030  // Event logging functions
1031  // ----------------------------------------------------------------------
1032 
1037  const Fw::StringBase& dirName,
1038  U32 status
1039  ) const;
1040 
1045  const Fw::StringBase& dirName,
1046  U32 status
1047  ) const;
1048 
1053  const Fw::StringBase& sourceFileName,
1054  const Fw::StringBase& destFileName,
1055  U32 status
1056  ) const;
1057 
1062  const Fw::StringBase& fileName,
1063  U32 status
1064  ) const;
1065 
1070  const Fw::StringBase& source,
1071  const Fw::StringBase& target,
1072  U32 status
1073  ) const;
1074 
1079  const Fw::StringBase& source,
1080  const Fw::StringBase& target
1081  ) const;
1082 
1087  const Fw::StringBase& dirName
1088  ) const;
1089 
1094  const Fw::StringBase& dirName
1095  ) const;
1096 
1101  const Fw::StringBase& sourceFileName,
1102  const Fw::StringBase& destFileName
1103  ) const;
1104 
1109  const Fw::StringBase& fileName
1110  ) const;
1111 
1116  const Fw::StringBase& source,
1117  const Fw::StringBase& target
1118  ) const;
1119 
1124  const Fw::StringBase& dirName
1125  ) const;
1126 
1131  const Fw::StringBase& dirName
1132  ) const;
1133 
1138  const Fw::StringBase& sourceFileName,
1139  const Fw::StringBase& destFileName
1140  ) const;
1141 
1146  const Fw::StringBase& fileName
1147  ) const;
1148 
1153  const Fw::StringBase& fileName,
1154  FwSizeType size
1155  ) const;
1156 
1161  const Fw::StringBase& fileName,
1162  U32 status
1163  ) const;
1164 
1169  const Fw::StringBase& fileName
1170  ) const;
1171 
1176  const Fw::StringBase& dirName
1177  ) const;
1178 
1183  const Fw::StringBase& dirName,
1184  U32 fileCount
1185  ) const;
1186 
1191  const Fw::StringBase& dirName,
1192  U32 status
1193  ) const;
1194 
1199  const Fw::StringBase& dirName,
1200  const Fw::StringBase& fileName,
1201  FwSizeType fileSize
1202  ) const;
1203 
1208  const Fw::StringBase& dirName,
1209  const Fw::StringBase& subdirName
1210  ) const;
1211 
1216  const Fw::StringBase& fileName
1217  ) const;
1218 
1223  const Fw::StringBase& fileName,
1224  U32 status
1225  ) const;
1226 
1231  const Fw::StringBase& fileName,
1232  U32 crc
1233  ) const;
1234 
1239  const Fw::StringBase& fileName,
1240  const Fw::StringFormatStatus& status
1241  ) const;
1242 
1247  const Fw::StringBase& fileName,
1248  U64 bytesToWrite
1249  ) const;
1250 
1255  const Fw::StringBase& fileName,
1256  U32 chunks
1257  ) const;
1258 
1263  const Fw::StringBase& fileName,
1264  const Svc::FileManager_GenerateDpStage& stage,
1265  U32 status
1266  ) const;
1267 
1272  const Fw::StringBase& fileName
1273  ) const;
1274 
1279  const Fw::StringBase& fileName,
1280  U64 beginOffset,
1281  U64 endOffset,
1282  U64 fileSize
1283  ) const;
1284 
1289  const Fw::StringBase& path,
1290  const Fw::StringBase& sandboxDir
1291  ) const;
1292 
1293  protected:
1294 
1295  // ----------------------------------------------------------------------
1296  // Telemetry serialized write
1297  // ----------------------------------------------------------------------
1298 
1303  void tlmWrite(
1304  FwChanIdType id,
1305  Fw::TlmBuffer& _tlmBuff,
1306  Fw::Time _tlmTime = Fw::Time()
1307  ) const;
1308 
1309  protected:
1310 
1311  // ----------------------------------------------------------------------
1312  // Telemetry write functions
1313  // ----------------------------------------------------------------------
1314 
1319  U32 arg,
1320  Fw::Time _tlmTime = Fw::Time()
1321  ) const;
1322 
1326  void tlmWrite_Errors(
1327  U32 arg,
1328  Fw::Time _tlmTime = Fw::Time()
1329  ) const;
1330 
1331  protected:
1332 
1333  // ----------------------------------------------------------------------
1334  // Functions for managing data products
1335  // ----------------------------------------------------------------------
1336 
1340  FwSizeType dataSize,
1341  DpContainer& container
1342  ) {
1343  return this->dpGet(
1345  dataSize,
1347  container
1348  );
1349  }
1350 
1352  void dpSend(
1353  DpContainer& container,
1354  Fw::Time timeTag = Fw::ZERO_TIME
1355  );
1356 
1357  protected:
1358 
1359  // ----------------------------------------------------------------------
1360  // Time
1361  // ----------------------------------------------------------------------
1362 
1366  Fw::Time getTime() const;
1367 
1368  private:
1369 
1370  // ----------------------------------------------------------------------
1371  // Message dispatch functions
1372  // ----------------------------------------------------------------------
1373 
1375  virtual MsgDispatchStatus doDispatch();
1376 
1377  private:
1378 
1379  // ----------------------------------------------------------------------
1380  // Calls for messages received on special input ports
1381  // ----------------------------------------------------------------------
1382 
1384  static void m_p_cmdIn_in(
1385  Fw::PassiveComponentBase* callComp,
1386  FwIndexType portNum,
1387  FwOpcodeType opCode,
1388  U32 cmdSeq,
1389  Fw::CmdArgBuffer& args
1390  );
1391 
1392  private:
1393 
1394  // ----------------------------------------------------------------------
1395  // Calls for messages received on typed input ports
1396  // ----------------------------------------------------------------------
1397 
1399  static void m_p_pingIn_in(
1400  Fw::PassiveComponentBase* callComp,
1401  FwIndexType portNum,
1402  U32 key
1403  );
1404 
1406  static void m_p_schedIn_in(
1407  Fw::PassiveComponentBase* callComp,
1408  FwIndexType portNum,
1409  U32 context
1410  );
1411 
1412  private:
1413 
1414  // ----------------------------------------------------------------------
1415  // Invocation functions for special output ports
1416  // ----------------------------------------------------------------------
1417 
1418 #if FW_ENABLE_TEXT_LOGGING
1419 
1421  void LogText_out(
1422  FwIndexType portNum,
1423  FwEventIdType id,
1424  Fw::Time& timeTag,
1425  const Fw::LogSeverity& severity,
1426  Fw::TextLogString& text
1427  ) const;
1428 
1429 #endif
1430 
1432  void cmdRegOut_out(
1433  FwIndexType portNum,
1434  FwOpcodeType opCode
1435  ) const;
1436 
1438  void cmdResponseOut_out(
1439  FwIndexType portNum,
1440  FwOpcodeType opCode,
1441  U32 cmdSeq,
1442  const Fw::CmdResponse& response
1443  ) const;
1444 
1446  void eventOut_out(
1447  FwIndexType portNum,
1448  FwEventIdType id,
1449  Fw::Time& timeTag,
1450  const Fw::LogSeverity& severity,
1451  Fw::LogBuffer& args
1452  ) const;
1453 
1455  Fw::Success productGetOut_out(
1456  FwIndexType portNum,
1457  FwDpIdType id,
1458  FwSizeType dataSize,
1459  Fw::Buffer& buffer
1460  ) const;
1461 
1463  void productSendOut_out(
1464  FwIndexType portNum,
1465  FwDpIdType id,
1466  const Fw::Buffer& buffer
1467  ) const;
1468 
1470  void timeCaller_out(
1471  FwIndexType portNum,
1472  Fw::Time& time
1473  ) const;
1474 
1476  void tlmOut_out(
1477  FwIndexType portNum,
1478  FwChanIdType id,
1479  Fw::Time& timeTag,
1480  Fw::TlmBuffer& val
1481  ) const;
1482 
1483  private:
1484 
1485  // ----------------------------------------------------------------------
1486  // Private data product handling functions
1487  // ----------------------------------------------------------------------
1488 
1491  Fw::Success::T dpGet(
1492  ContainerId::T containerId,
1493  FwSizeType dataSize,
1494  FwDpPriorityType priority,
1495  DpContainer& container
1496  );
1497 
1498 #if !FW_DIRECT_PORT_CALLS
1499 
1500  private:
1501 
1502  // ----------------------------------------------------------------------
1503  // Special input ports
1504  // ----------------------------------------------------------------------
1505 
1507  Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS];
1508 
1509 #endif
1510 
1511 #if !FW_DIRECT_PORT_CALLS
1512 
1513  private:
1514 
1515  // ----------------------------------------------------------------------
1516  // Typed input ports
1517  // ----------------------------------------------------------------------
1518 
1520  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
1521 
1523  Svc::InputSchedPort m_schedIn_InputPort[NUM_SCHEDIN_INPUT_PORTS];
1524 
1525 #endif
1526 
1527 #if !FW_DIRECT_PORT_CALLS
1528 
1529  private:
1530 
1531  // ----------------------------------------------------------------------
1532  // Special output ports
1533  // ----------------------------------------------------------------------
1534 
1535 #if FW_ENABLE_TEXT_LOGGING == 1
1536 
1538  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
1539 
1540 #endif
1541 
1543  Fw::OutputCmdRegPort m_cmdRegOut_OutputPort[NUM_CMDREGOUT_OUTPUT_PORTS];
1544 
1546  Fw::OutputCmdResponsePort m_cmdResponseOut_OutputPort[NUM_CMDRESPONSEOUT_OUTPUT_PORTS];
1547 
1549  Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
1550 
1552  Fw::OutputDpGetPort m_productGetOut_OutputPort[NUM_PRODUCTGETOUT_OUTPUT_PORTS];
1553 
1555  Fw::OutputDpSendPort m_productSendOut_OutputPort[NUM_PRODUCTSENDOUT_OUTPUT_PORTS];
1556 
1558  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
1559 
1561  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
1562 
1563 #endif
1564 
1565 #if !FW_DIRECT_PORT_CALLS
1566 
1567  private:
1568 
1569  // ----------------------------------------------------------------------
1570  // Typed output ports
1571  // ----------------------------------------------------------------------
1572 
1574  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
1575 
1576 #endif
1577 
1578  };
1579 
1580 }
1581 
1582 #endif
bool isConnected_productSendOut_OutputPort(FwIndexType portNum) const
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
An error occurred while attempting to move a file.
A data product Container.
Definition: DpContainer.hpp:26
virtual void run_internalInterfaceHandler()=0
Internal interface handler for run.
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
The File System component began moving a file to a new location.
void log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::StringBase &dirName) const
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
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.
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
void run_internalInterfaceInvoke()
Internal interface base-class function for run.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
The File System component began deleting a directory.
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.
An error occurred while attempting to remove a directory.
The File System component deleted and existing directory without error.
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
The File System component returned status non-zero when trying to append 2 files together.
FPP shadow-enum representing Fw::FormatStatus.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
DpContainer()
Constructor with default initialization.
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)
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
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].
U16 FwSizeStoreType
The type used to serialize a size value.
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.
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)
static constexpr FwIndexType getNum_schedIn_InputPorts()
The File System component appended 2 files without error.
virtual void FileSize_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FileSize.
T
The raw enum type.
The File System component began deleting an existing file.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
virtual void CreateDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CreateDirectory.
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
A command path argument was rejected by the configured sandbox directory.
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
The File System component deleted an existing file without error.
void log_WARNING_HI_DirectoryRemoveError(const Fw::StringBase &dirName, U32 status) const
The File System component appended 2 files without error.
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
The File System component moved a file to a new location without error.
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
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
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()
RateGroupDivider component implementation.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
The File System component began creating a new directory.
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.
Invalid offset range requested for data product generation.
virtual void RemoveDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveDirectory.
An error occurred while attempting to create a directory.
The File System component created a new directory without error.
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].
Append 1 file&#39;s contents to the end of another.
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)
An error occurred while attempting to remove a file.
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()
virtual void AppendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)=0