Sleeping Wombat Common Library  0.50.0
swCommonLibrary
Macros | Typedefs | Functions
TypesDefinitions.h File Reference

Plik zawiera definicje podstawowych typów zmiennych. More...

#include <cstdint>
#include <memory>

Go to the source code of this file.

Macros

#define DEFINE_PTR_TYPE(type)   typedef Ptr< type > type ## Ptr;
 
#define DEFINE_UPTR_TYPE(type)   typedef UPtr< type > type ## UPtr;
 
#define DEFINE_WPTR_TYPE(type)   typedef std::weak_ptr< type > type ## WPtr;
 
#define DEFINE_OPTR_TYPE(type)   typedef OPtr< type > type ## OPtr;
 
#define CLASS_TESTER(type)   __ ## type ## __Tester
 
#define FRIEND_CLASS_TESTER(type)   friend class CLASS_TESTER( type );
 

Typedefs

typedef int8_t int8
 
typedef uint8_t uint8
 
typedef int16_t int16
 
typedef uint16_t uint16
 
typedef int32_t int32
 
typedef uint32_t uint32
 
typedef int64_t int64
 
typedef uint64_t uint64
 
typedef size_t Size
 
typedef ptrdiff_t PtrOffset
 
typedef double TimeType
 
typedef rttr::type ActorType
 
template<typename PtrType >
using UPtr = std::shared_ptr< PtrType >
 
template<typename PtrType >
using Ptr = std::shared_ptr< PtrType >
 
template<typename PtrType >
using OPtr = std::unique_ptr< PtrType >
 

Functions

template<typename PtrType , typename... Args>
Ptr< PtrType > MakePtr (Args &&...args)
 
template<typename PtrType , typename... Args>
UPtr< PtrType > MakeUPtr (Args...args)
 
template<typename PtrType , typename... Args>
UPtr< PtrType > MakeOPtr (Args...args)
 

Detailed Description

Plik zawiera definicje podstawowych typów zmiennych.

Author
nieznanysprawiciel

Zmienne są mają stały rozmiar, powinny być mniej więcej niezależne od platformy bo opierają się na bibliotece standardowej. Mimo wszystko moze się zdarzyć, że na jakichś platformach typy nie istnieją i wtedy jest problem.

Definicje są stworzone w celu łatwiejszego użytku. Biblioteka standardowa definiuje np. typ int8_t, który jest zamieniany na int8.

Typedef Documentation

template<typename PtrType >
using OPtr = std::unique_ptr< PtrType >

Declares that class holding this pointer is it's owner. Note: there's only semantical difference between OPtr and UPtr. UPtr should be unique in whole system. OPtr says that, there can exist some raw pointers, but class holding this pointer is responsible for releasing memory.

template<typename PtrType >
using UPtr = std::shared_ptr< PtrType >
Todo:
Use std::unique_ptr instead. Unique_ptr didn't want to compile in current visual compiler.