This commit is contained in:
Isuru Samarathunga
2025-11-08 23:46:27 +05:30
parent a7abdbae57
commit 1118ec3205
2 changed files with 17 additions and 10 deletions

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "interface/StreamReader.interface.inl" #include "Interface/StreamReader.interface.inl"
namespace ia namespace ia
{ {

View File

@ -1,16 +1,16 @@
// IACore-OSS; The Core Library for All IA Open Source Projects // IACore-OSS; The Core Library for All IA Open Source Projects
// Copyright (C) 2024 IAS (ias@iasoft.dev) // Copyright (C) 2024 IAS (ias@iasoft.dev)
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
@ -19,11 +19,18 @@
#include <IACore/Base.hpp> #include <IACore/Base.hpp>
#include <memory> #include <memory>
#define REF_PTR_CLASS \
template<typename _value_type, typename... Args> friend INLINE RefPtr<_value_type> MakeRefPtr(Args &&...args) \
{ \
return std::make_shared<_value_type>(std::forward<Args>(args)...); \
}
namespace ia namespace ia
{ {
template<typename _value_type> template<typename _value_type> using RefPtr = std::shared_ptr<_value_type>;
using RefPtr = std::shared_ptr<_value_type>;
template<typename _value_type, typename... Args> template<typename _value_type, typename... Args> INLINE RefPtr<_value_type> MakeRefPtr(Args &&...args)
INLINE RefPtr<_value_type> MakeRefPtr(Args... args) { return std::make_shared<_value_type>(args...); } {
} return std::make_shared<_value_type>(std::forward<Args>(args)...);
}
} // namespace ia