qb
2.0.0.0
C++17 Actor Framework
|
CPU information and utilities. More...
#include <memory>
#include <thread>
Go to the source code of this file.
Classes | |
class | qb::CPU |
Provides platform-independent access to CPU information. More... |
Namespaces | |
namespace | Internals |
Internal helper functions for CPU information. |
Functions | |
template<typename T, typename TCleaner> | |
auto | qb::resource (T handle, TCleaner cleaner) |
Creates a unique_ptr with a custom deleter for a resource. | |
template<typename TCleaner> | |
auto | qb::resource (void *handle, TCleaner cleaner) |
Creates a unique_ptr with a custom deleter for a void* resource. | |
template<typename TCleaner> | |
auto | qb::resource (TCleaner cleaner) |
Creates a unique_ptr with a custom deleter using the deleter itself as a handle. | |
void | qb::spin_loop_pause () noexcept |
Fallback implementation of spin_loop_pause for platforms without CPU pause. |
CPU information and utilities.
This file provides platform-independent access to CPU information such as architecture, core count, and frequency. It also includes utilities for CPU-specific operations like spinlock pauses.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
auto qb::resource | ( | T | handle, |
TCleaner | cleaner ) |
Creates a unique_ptr with a custom deleter for a resource.
This is a helper function to manage resources in a RAII manner with a custom deleter function.
T | Type of the resource |
TCleaner | Type of the cleaner/deleter function |
handle | Resource handle |
cleaner | Deleter function |
auto qb::resource | ( | void * | handle, |
TCleaner | cleaner ) |
Creates a unique_ptr with a custom deleter for a void* resource.
Specialization for void* resources.
TCleaner | Type of the cleaner/deleter function |
handle | Resource handle |
cleaner | Deleter function |
auto qb::resource | ( | TCleaner | cleaner | ) |
Creates a unique_ptr with a custom deleter using the deleter itself as a handle.
This variant is useful for self-contained resources.
TCleaner | Type of the cleaner/deleter function |
cleaner | Deleter function |
|
inlinenoexcept |
Fallback implementation of spin_loop_pause for platforms without CPU pause.
Calls std::this_thread::yield() as a fallback.