F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
FileManager.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileManager.hpp
3 // \author bocchino
4 // \brief hpp file for FileManager component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef Svc_FileManager_HPP
14 #define Svc_FileManager_HPP
15 
17 #include "Os/FileSystem.hpp"
18 
19 namespace Svc {
20 
21  class FileManager :
23  {
24 
25  public:
26 
27  // ----------------------------------------------------------------------
28  // Construction, initialization, and destruction
29  // ----------------------------------------------------------------------
30 
34  const char *const compName
35  );
36 
39  void init(
40  const NATIVE_INT_TYPE queueDepth,
41  const NATIVE_INT_TYPE instance
42  );
43 
46  ~FileManager(void);
47 
49 
50  // ----------------------------------------------------------------------
51  // Command handler implementations
52  // ----------------------------------------------------------------------
53 
56  void CreateDirectory_cmdHandler(
57  const FwOpcodeType opCode,
58  const U32 cmdSeq,
60  );
61 
65  const FwOpcodeType opCode,
66  const U32 cmdSeq,
67  const Fw::CmdStringArg& fileName
68  );
69 
73  const FwOpcodeType opCode,
74  const U32 cmdSeq,
75  const Fw::CmdStringArg& sourceFileName,
76  const Fw::CmdStringArg& destFileName
77  );
78 
82  const FwOpcodeType opCode,
83  const U32 cmdSeq,
85  );
86 
90  const FwOpcodeType opCode,
91  const U32 cmdSeq,
92  const Fw::CmdStringArg& command,
93  const Fw::CmdStringArg& logFileName
94  );
95 
99  const FwOpcodeType opCode,
100  const U32 cmdSeq,
101  const Fw::CmdStringArg& source,
102  const Fw::CmdStringArg& target
103  );
104 
107  void pingIn_handler(
108  const NATIVE_INT_TYPE portNum,
109  U32 key
110  );
111 
113 
114  // ----------------------------------------------------------------------
115  // Helper methdods
116  // ----------------------------------------------------------------------
117 
120  NATIVE_INT_TYPE systemCall(
121  const Fw::CmdStringArg& command,
122  const Fw::CmdStringArg& logFileName
123  ) const;
124 
127  void emitTelemetry(
129  );
130 
133  void sendCommandResponse(
134  const FwOpcodeType opCode,
135  const U32 cmdSeq,
137  );
138 
140 
141  // ----------------------------------------------------------------------
142  // Variables
143  // ----------------------------------------------------------------------
144 
147  U32 commandCount;
148 
152 
153 
154  };
155 
156 } // end namespace Svc
157 
158 #endif
Svc::FileManager::emitTelemetry
void emitTelemetry(const Os::FileSystem::Status status)
Definition: FileManager.cpp:247
Svc::FileManager::AppendFile_cmdHandler
void AppendFile_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)
Definition: FileManager.cpp:186
Svc::FileManagerComponentBase::status
PROTECTED U32 status
Definition: FileManagerComponentAc.hpp:681
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Svc::FileManager
Definition: FileManager.hpp:23
Svc::FileManager::sendCommandResponse
void sendCommandResponse(const FwOpcodeType opCode, const U32 cmdSeq, const Os::FileSystem::Status status)
Definition: FileManager.cpp:260
Os::FileSystem::Status
Status
Definition: FileSystem.hpp:15
Svc::FileManager::dirName
PRIVATE const U32 const Fw::CmdStringArg & dirName
< The directory to create
Definition: FileManager.hpp:60
Svc::FileManagerComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: FileManagerComponentAc.hpp:935
Fw::CmdStringArg
Definition: CmdString.hpp:11
FileSystem.hpp
Svc::FileManager::ShellCommand_cmdHandler
void ShellCommand_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Fw::CmdStringArg &command, const Fw::CmdStringArg &logFileName)
Definition: FileManager.cpp:153
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Svc::FileManager::~FileManager
~FileManager(void)
Definition: FileManager.cpp:47
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:62
Svc::FileManager::errorCount
U32 errorCount
Definition: FileManager.hpp:151
Svc::FileManagerComponentBase::key
PROTECTED U32 key
Definition: FileManagerComponentAc.hpp:249
Svc::FileManager::RemoveDirectory_cmdHandler
void RemoveDirectory_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Fw::CmdStringArg &dirName)
Definition: FileManager.cpp:130
Svc::FileManager::cmdSeq
PRIVATE const U32 cmdSeq
The command sequence number.
Definition: FileManager.hpp:58
Svc::FileManagerComponentBase::opCode
PRIVATE NATIVE_INT_TYPE FwOpcodeType opCode
Definition: FileManagerComponentAc.hpp:936
Svc
Definition: ActiveLoggerComponentAc.cpp:22
FileManagerComponentAc.hpp
Svc::FileManager::pingIn_handler
void pingIn_handler(const NATIVE_INT_TYPE portNum, U32 key)
Definition: FileManager.cpp:217
Svc::FileManager::RemoveFile_cmdHandler
void RemoveFile_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Fw::CmdStringArg &fileName)
Definition: FileManager.cpp:80
Svc::FileManagerComponentBase
Auto-generated base for FileManager component.
Definition: FileManagerComponentAc.hpp:47
Svc::FileManager::MoveFile_cmdHandler
void MoveFile_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName)
Definition: FileManager.cpp:103
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Svc::FileManager::FileManager
FileManager(const char *const compName)
Definition: FileManager.cpp:27