Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jan 31, 2025
1 parent 91449a3 commit b8f4478
Show file tree
Hide file tree
Showing 21 changed files with 640 additions and 722 deletions.
7 changes: 2 additions & 5 deletions src/cloud_storage/CloudStorage.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* 2025-01-27
* 2025-01-31
*
* The MIT License (MIT)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -36,7 +36,6 @@ using namespace firebase_ns;

class CloudStorage
{

friend class AppBase;

public:
Expand Down Expand Up @@ -610,7 +609,7 @@ class CloudStorage
request.aClient->addRemoveClientVec(reinterpret_cast<uint32_t>(&(cVec)), true);

if (request.aResult)
sData->setRefResult(request.aResult, reinterpret_cast<uint32_t>(&(request.aClient->rVec)));
sData->setRefResult(request.aResult, reinterpret_cast<uint32_t>(&(request.aClient->getResultList())));

request.aClient->process(sData->async);
request.aClient->handleRemove();
Expand All @@ -634,7 +633,5 @@ class CloudStorage
}
}
};

#endif

#endif
7 changes: 0 additions & 7 deletions src/cloud_storage/DataOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ namespace GoogleCloudStorage

struct BaseOptions : public BaseO8
{

protected:
ObjectWriter owriter;
URLUtil uut;
Expand Down Expand Up @@ -134,7 +133,6 @@ namespace GoogleCloudStorage

struct GetOptions : public BaseOptions
{

public:
BaseOptions &projection(PROJECTION_OPTIONS value)
{
Expand All @@ -156,7 +154,6 @@ namespace GoogleCloudStorage

struct InsertOptions : public BaseO10
{

private:
ObjectWriter owriter;
StringUtil sut;
Expand Down Expand Up @@ -244,7 +241,6 @@ namespace GoogleCloudStorage

struct ListOptions : public BaseO10
{

private:
ObjectWriter owriter;
URLUtil uut;
Expand Down Expand Up @@ -388,7 +384,6 @@ namespace GoogleCloudStorage

class DataOptions
{

public:
String payload, extras;
Parent parent;
Expand Down Expand Up @@ -437,7 +432,5 @@ namespace GoogleCloudStorage
}
};
}

#endif

#endif
8 changes: 4 additions & 4 deletions src/core/AppBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class AppBase
protected:
void setResultUID(AsyncResult *aResult, const String &uid) { aResult->val[ares_ns::res_uid] = uid; }
void setRVec(AsyncResult *aResult, uint32_t addr) { aResult->rvec_addr = addr; }
std::vector<uint32_t> &getRVec(AsyncClientClass *aClient) { return aClient->rVec; }
app_debug_t *getAppDebug(AsyncClientClass *aClient) { return &aClient->app_debug; }
std::vector<uint32_t> &getRVec(AsyncClientClass *aClient) { return aClient->getResultList(); }
app_debug_t *getAppDebug(AsyncClientClass *aClient) { return &aClient->getAppDebug(); }
void resultSetDebug(AsyncResult *aResult, app_debug_t *app_debug) { aResult->app_debug = app_debug; }
void resultSetEvent(AsyncResult *aResult, app_event_t *app_event) { aResult->app_event = app_event; }
app_event_t *getAppEvent(AsyncClientClass *aClient) { return &aClient->app_event; }
app_event_t *getAppEvent(AsyncClientClass *aClient) { return &aClient->getAppEvent(); }
void stopAsync(AsyncClientClass *aClient) { aClient->stop(); }
async_data *createSlotBase(AsyncClientClass *aClient, slot_options_t &soption)
{
Expand All @@ -31,7 +31,7 @@ class AppBase
void setContentLengthBase(AsyncClientClass *aClient, async_data *sData, size_t len) { sData->request.setContentLength(len); }
void handleRemoveBase(AsyncClientClass *aClient) { aClient->handleRemove(); }
void removeSlotBase(AsyncClientClass *aClient, uint8_t slot, bool sse = true) { aClient->removeSlot(slot, sse); }
size_t slotCountBase(AsyncClientClass *aClient) { return aClient->sVec.size(); }
size_t slotCountBase(AsyncClientClass *aClient) { return aClient->slotCount(); }
void setLastErrorBase(AsyncResult *aResult, int code, const String &message)
{
if (aResult)
Expand Down
Loading

0 comments on commit b8f4478

Please sign in to comment.