20 #ifndef MIRTK_Memory_H 21 #define MIRTK_Memory_H 36 using UniquePtr = std::unique_ptr<T>;
39 using SharedPtr = std::shared_ptr<T>;
42 using WeakPtr = std::weak_ptr<T>;
45 SharedPtr<T> NewShared()
47 return std::make_shared<T>();
50 template <
class T,
class... Args>
51 SharedPtr<T> NewShared(Args&&... args)
53 return std::make_shared<T>(args...);
74 void swap16(
char *,
char *,
long);
77 void swap32(
char *,
char *,
long);
80 void swap64(
char *,
char *,
long);
98 #include "mirtk/Allocate.h" 99 #include "mirtk/Deallocate.h" 102 #endif // MIRTK_Memory_H
void swap32(char *, char *, long)
Swap bytes of two word.
ByteOrder GetByteOrder()
Get byte order of this system.
ByteOrder
Byte order of each word in memory.
void swap64(char *, char *, long)
Swap bytes of four word.
void swap16(char *, char *, long)
Swap bytes of a single word.