Skip to content

Commit

Permalink
*DatDom: add UniData.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
fchn289 committed Feb 13, 2024
1 parent f89a4d6 commit 17f7082
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/domino/UniData.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright 2024 Nokia
* Licensed under the BSD 3 Clause license
* SPDX-License-Identifier: BSD-3-Clause
*/
// ***********************************************************************************************
// - why:
// . example to support SafePtr & shared_ptr as UniData
// . users can modify this file for their req
// - why support shared_ptr?
// . from mem-safe pov, SafePtr is the only choice
// . shared_ptr may be same safe as SafePtr, then SafePtr is unnecessary
// ***********************************************************************************************
#pragma once

#include <memory> // make_shared

using namespace std;

namespace RLib
{

#if 1
using UniData = shared_ptr<void>;
#define MAKE_UNI_DATA make_shared
#else
using UniData = SafePtr<void>;
#define MAKE_UNI_DATA make_safe
#endif

} // namespace
// ***********************************************************************************************
// YYYY-MM-DD Who v)Modification Description
// .......... ......... .......................................................................
// 2024-02-13 CSZ 1)create
// ***********************************************************************************************

0 comments on commit 17f7082

Please sign in to comment.