Skip to content

Commit

Permalink
reset endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
bha-evs committed Sep 5, 2024
1 parent c9ab1be commit 75d49cc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#emrun --browser chrome --port 8080 --serve_after_close --serve_after_exit C:\bld\bofstd-web\binaries\bin
#select .html file
#compil windows:
#cmake -DCMAKE_TOOLCHAIN_FILE=C:/pro/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_SHARED_LIBS=OFF -DVCPKG_OVERLAY_PORTS=C:/pro/vcpkg/ports -DCMAKE_INSTALL_PREFIX=C:/tmp/bofstd -SC:/pro/github/bofstd -BC:/bld/bofstd-win
#cmake -DCMAKE_INSTALL_PREFIX=C:/tmp/bofstd -DCMAKE_TOOLCHAIN_FILE=C:/pro/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_SHARED_LIBS=OFF -DVCPKG_OVERLAY_PORTS=C:/pro/vcpkg/ports -SC:/pro/github/bofstd -BC:/bld/bofstd-win
#compil linux:
#cmake -DCMAKE_TOOLCHAIN_FILE=/home/bha/pro/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux -DBUILD_SHARED_LIBS=OFF -DVCPKG_OVERLAY_PORTS=/home/bha/pro/vcpkg/ports -DCMAKE_INSTALL_PREFIX=/tmp/bofstd -DRHEL:STRING="el9" -S/home/bha/pro/github/bofstd -B/home/bha/bld/bofstd-lin

Expand Down
18 changes: 1 addition & 17 deletions lib/include/bofstd/bofserviceendpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@

BEGIN_BOF_NAMESPACE()

struct BOF_SERVICE_ENPOINT_META_DATA
{
bool UserMaster_B;
std::string UserArg_S;
void *pUser;

BOF_SERVICE_ENPOINT_META_DATA()
{
Reset();
}
void Reset()
{
UserMaster_B = false;
UserArg_S = "";
pUser = nullptr;
}
};
class BOFSTD_EXPORT BofServiceEndpoint
{
public:
Expand All @@ -52,6 +35,7 @@ class BOFSTD_EXPORT BofServiceEndpoint
~BofServiceEndpoint();
bool IsValid();
std::string ToString(bool _ShowName_B);
void Reset();

bool SetServiceMetaData(void *_pServiceEndpointMetaData);
bool SetServiceName(const std::string &_rServiceName_S);
Expand Down
2 changes: 2 additions & 0 deletions lib/include/bofstd/bofuri.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ class BOFSTD_EXPORT BofUri
/// @remarks Different operator.
bool operator!=(const BofUri &_rOther_O) const;

void Reset();

/// @brief Check if the uri instance is well formed.
/// @return true if the uri is valid.
/// @remarks None
Expand Down
8 changes: 8 additions & 0 deletions lib/src/bofserviceendpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ std::string BofServiceEndpoint::ToString(bool _ShowName_B)
Rts += mUri.ToString();
return Rts;
}
void BofServiceEndpoint::Reset()
{
mUri.Reset();
mServiceName_S="";
mServiceInstance_S="";
mServiceTagCollection.clear();
mpServiceEndpointMetaData = nullptr;
}
bool BofServiceEndpoint::SetServiceMetaData(void *_pServiceEndpointMetaData)
{
mpServiceEndpointMetaData = _pServiceEndpointMetaData;
Expand Down
9 changes: 9 additions & 0 deletions lib/src/bofuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,16 @@ bool BofUri::operator!=(const BofUri &_rOther_O) const
{
return !(*this == _rOther_O);
}
void BofUri::Reset()
{
mSchemeAuthority_X.Reset();
mPath="";
mQueryParamCollection.clear();
mFragment_S="";

mQueryParamDelimiter_c = '&';
mValid_B = false;
}
bool BofUri::IsValid() const
{
return (mValid_B);
Expand Down

0 comments on commit 75d49cc

Please sign in to comment.