omni::core::Generated< omni::platforminfo::IMemoryInfo_abi >

Defined in omni/platforminfo/IMemoryInfo.gen.h

template<>
class Generated<omni::platforminfo::IMemoryInfo_abi> : public omni::platforminfo::IMemoryInfo_abi

Interface to collect and retrieve information about memory installed in the system.

Subclassed by omni::platforminfo::IMemoryInfo

Public Functions

inline size_t getTotalPhysicalMemory() noexcept

Retrieves the total installed physical RAM in the system.

Thread Safety

This call is thread safe.

Returns

The number of bytes of physical RAM installed in the system. This value will not change during the lifetime of the calling process.

inline size_t getAvailablePhysicalMemory() noexcept

Retrieves the available physical memory in the system.

Thread Safety

This call is thread safe. However, two consecutive or concurrent calls are unlikely to return the same value.

Returns

The number of bytes of physical RAM that is currently available for use by the operating system. Note that this is not a measure of how much memory is available to the calling process, but rather for the entire system.

inline size_t getTotalPageFileMemory() noexcept

Retrieves the total page file space in the system.

Thread Safety

This call is thread safe.

Returns

The number of bytes of page file space in the system. The value will not change during the lifetime of the calling process.

inline size_t getAvailablePageFileMemory() noexcept

Retrieves the available page file space in the system.

Thread Safety

This call is thread safe. However, two consecutive or concurrent calls are unlikely to return the same value.

Returns

The number of bytes of page file space that is currently available for use by the operating system.

inline size_t getProcessMemoryUsage() noexcept

Retrieves the total memory usage for the calling process.

Thread Safety

This call is thread safe. However, two consecutive calls are unlikely to return the same value.

Returns

The number of bytes of memory used by the calling process. This will not necessarily be the amount of the process’s virtual memory space that is currently in use, but rather the amount of memory that the OS currently has wired for this process (ie: the process’s working set memory). It is possible that the process could have a lot more memory allocated, just inactive as far as the OS is concerned.

inline size_t getProcessPeakMemoryUsage() noexcept

Retrieves the peak memory usage of the calling process.

Returns

The maximum number of bytes of memory used by the calling process. This will not necessarily be the maximum amount of the process’s virtual memory space that was ever allocated, but rather the maximum amount of memory that the OS ever had wired for the process (ie: the process’s working set memory). It is possible that the process could have had a lot more memory allocated, just inactive as far as the OS is concerned.

inline void *cast(omni::core::TypeId id) noexcept

Returns a pointer to the interface defined by the given type id if this object implements the type id’s interface.

Objects can support multiple interfaces, even interfaces that are in different inheritance chains.

The returned object will have omni::core::IObject::acquire() called on it before it is returned, meaning it is up to the caller to call omni::core::IObject::release() on the returned pointer.

The returned pointer can be safely reinterpret_cast<> to the type id’s C++ class. For example, “omni.windowing.IWindow” can be cast to omni::windowing::IWindow.

Do not directly use this method, rather use a wrapper function like omni::core::cast() or omni::core::ObjectPtr::as().

Thread Safety

This method is thread safe.

inline void acquire() noexcept

Increments the object’s reference count.

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

inline void release() noexcept

Decrements the objects reference count.

Most implementations will destroy the object if the reference count reaches 0 (though this is not a requirement).

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

Protected Functions

virtual size_t getTotalPhysicalMemory_abi() noexcept = 0

Retrieves the total installed physical RAM in the system.

Thread Safety

This call is thread safe.

Returns

The number of bytes of physical RAM installed in the system. This value will not change during the lifetime of the calling process.

virtual size_t getAvailablePhysicalMemory_abi() noexcept = 0

Retrieves the available physical memory in the system.

Thread Safety

This call is thread safe. However, two consecutive or concurrent calls are unlikely to return the same value.

Returns

The number of bytes of physical RAM that is currently available for use by the operating system. Note that this is not a measure of how much memory is available to the calling process, but rather for the entire system.

virtual size_t getTotalPageFileMemory_abi() noexcept = 0

Retrieves the total page file space in the system.

Thread Safety

This call is thread safe.

Returns

The number of bytes of page file space in the system. The value will not change during the lifetime of the calling process.

virtual size_t getAvailablePageFileMemory_abi() noexcept = 0

Retrieves the available page file space in the system.

Thread Safety

This call is thread safe. However, two consecutive or concurrent calls are unlikely to return the same value.

Returns

The number of bytes of page file space that is currently available for use by the operating system.

virtual size_t getProcessMemoryUsage_abi() noexcept = 0

Retrieves the total memory usage for the calling process.

Thread Safety

This call is thread safe. However, two consecutive calls are unlikely to return the same value.

Returns

The number of bytes of memory used by the calling process. This will not necessarily be the amount of the process’s virtual memory space that is currently in use, but rather the amount of memory that the OS currently has wired for this process (ie: the process’s working set memory). It is possible that the process could have a lot more memory allocated, just inactive as far as the OS is concerned.

virtual size_t getProcessPeakMemoryUsage_abi() noexcept = 0

Retrieves the peak memory usage of the calling process.

Returns

The maximum number of bytes of memory used by the calling process. This will not necessarily be the maximum amount of the process’s virtual memory space that was ever allocated, but rather the maximum amount of memory that the OS ever had wired for the process (ie: the process’s working set memory). It is possible that the process could have had a lot more memory allocated, just inactive as far as the OS is concerned.

virtual void *cast_abi(TypeId id) noexcept = 0

Returns a pointer to the interface defined by the given type id if this object implements the type id’s interface.

Objects can support multiple interfaces, even interfaces that are in different inheritance chains.

The returned object will have omni::core::IObject::acquire() called on it before it is returned, meaning it is up to the caller to call omni::core::IObject::release() on the returned pointer.

The returned pointer can be safely reinterpret_cast<> to the type id’s C++ class. For example, “omni.windowing.IWindow” can be cast to omni::windowing::IWindow.

Do not directly use this method, rather use a wrapper function like omni::core::cast() or omni::core::ObjectPtr::as().

Thread Safety

This method is thread safe.

virtual void acquire_abi() noexcept = 0

Increments the object’s reference count.

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

virtual void release_abi() noexcept = 0

Decrements the objects reference count.

Most implementations will destroy the object if the reference count reaches 0 (though this is not a requirement).

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.