Improve:AppManager include cleaner.

This commit is contained in:
Fancy code 2024-06-17 15:38:44 +08:00
parent 5fa12e5021
commit 9a5c945797
10 changed files with 48 additions and 7 deletions

View File

@ -16,9 +16,9 @@
#define HALMAKEPTR_H
#include "IHal.h"
#include "IHalCpp.h"
#include "StatusCode.h"
#include "KeyControl.h"
#include "LedControl.h"
#include "StatusCode.h"
#include <memory>
class HalMakePtr
{

View File

@ -23,7 +23,8 @@ public:
virtual ~SdCardHal() = default;
void SetSdCardMonitor(std::shared_ptr<VSdCardHalMonitor> &monitor) override;
SdCardHalStatus GetSdCardStatus(void) override;
StatusCode GetCapacity(unsigned long long &totalSizeMB, unsigned long long &freeSizeMB, unsigned long long &usedSizeMB) override;
StatusCode GetCapacity(unsigned long long &totalSizeMB, unsigned long long &freeSizeMB,
unsigned long long &usedSizeMB) override;
void Init(void);
void UnInit(void);
void DevDetectingThread(void);

View File

@ -13,9 +13,12 @@
* limitations under the License.
*/
#include "AppClient.h"
#include "IAppManager.h"
#include "IAppProtocolHandle.h"
#include "ILog.h"
#include "TcpModule.h"
#include <memory>
#include <string>
AppClient::AppClient(const void *clientObject) : mClientObject(clientObject)
{
}

View File

@ -15,10 +15,15 @@
#include "AppManager.h"
#include "AppClient.h"
#include "AppManagerMakePtr.h"
#include "IAppManager.h"
#include "IAppProtocolHandle.h"
#include "IHalCpp.h"
#include "ILog.h"
#include "StatusCode.h"
#include "TcpModule.h"
#include "WebServer.h"
#include <memory>
#include <sys/types.h>
AppManager::AppManager() : mTcpServer(nullptr), mInitRuning(false)
{
}

View File

@ -14,7 +14,11 @@
*/
#include "AppManagerMakePtr.h"
#include "AppManager.h"
#include "IAppManager.h"
#include "IAppProtocolHandle.h"
#include "ILog.h"
#include "StatusCode.h"
#include <memory>
// extern bool CreateProtocolHandleImpl();
bool CreateAppManagerModule(void)
{

View File

@ -14,6 +14,10 @@
*/
#include "IAppManager.h"
#include "ILog.h"
#include "StatusCode.h"
#include <memory>
#include <string>
#include <vector>
app_get_product_info::app_get_product_info()
{
}

View File

@ -13,7 +13,12 @@
* limitations under the License.
*/
#include "IAppProtocolHandle.h"
#include "IAppManager.h"
#include "ILog.h"
#include "WebServer.h"
#include <cstdlib>
#include <memory>
#include <string>
protocol_packet::~protocol_packet()
{
if (nullptr != mData) {

View File

@ -13,11 +13,21 @@
* limitations under the License.
*/
#include "SixFrameHandle.h"
#include "IAppManager.h"
#include "IAppProtocolHandle.h"
#include "ILog.h"
#include <WebServer.h>
#include <cJSON.h>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <memory>
#include <sstream>
#include <stdio.h>
#include <string>
#include <time.h>
#include <vector>
using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;
@ -1004,10 +1014,8 @@ std::shared_ptr<ProtocolPacket> SixFrameHandle::MakePacket(const cJSON *json)
if (nullptr != resultStr) {
return std::make_shared<ProtocolPacket>(resultStr, strlen(resultStr));
}
else {
LogError("MakePacket failed.\n");
return std::make_shared<ProtocolPacket>();
}
}
void SixFrameHandle::SetAppMonitor(std::shared_ptr<VAppMonitor> &monitor)
{

View File

@ -13,8 +13,12 @@
* limitations under the License.
*/
#include "SixFrameMakePtr.h"
#include "AppManagerMakePtr.h"
#include "IAppProtocolHandle.h"
#include "ILog.h"
#include "SixFrameHandle.h"
#include "StatusCode.h"
#include <memory>
bool CreateProtocolHandleImpl(void)
{
LogInfo("CreateProtocolHandleImpl SixFrameMakePtr.\n");

View File

@ -14,9 +14,16 @@
*/
#include "WebServer.h"
#include "ILog.h"
#include "StatusCode.h"
#include "goahead.h"
#include "js.h"
#include "osdep.h"
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
static int finished = 0;
static HttpHandleCallback gHttpHandle = NULL;
constexpr int UNKNOWN_LENGTH = -1;