anbox-platform-sdk  1.23.0
Anbox Platform SDK API documentation
platform.h File Reference
+ Include dependency graph for platform.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  anbox::Platform
 Platform defines the custom Anbox platform implemented by a plugin. More...
 

Namespaces

 anbox
 

Macros

#define ANBOX_PLATFORM_PLUGIN_DESCRIBE(platform_type, name, vendor, description)
 A descriptor that describes the basic information of the platform plugin. More...
 

Macro Definition Documentation

◆ ANBOX_PLATFORM_PLUGIN_DESCRIBE

#define ANBOX_PLATFORM_PLUGIN_DESCRIBE (   platform_type,
  name,
  vendor,
  description 
)
Value:
AnboxPlatformDescriptor anbox_platform_descriptor __attribute((section(ANBOX_PLATFORM_DESCRIPTOR_SECTION))) = \
{ name, vendor, description, ANBOX_PLATFORM_VERSION }; \
extern "C" { \
ANBOX_EXPORT AnboxPlatform* anbox_initialize(const AnboxPlatformConfiguration* configuration) { \
auto platform = std::make_unique<platform_type>(configuration); \
return anbox_platform_plugin_register(std::move(platform)); \
} \
ANBOX_EXPORT void anbox_deinitialize(AnboxPlatform* platform) { \
anbox_platform_plugin_unregister(platform); \
} \
}
AnboxPlatform * anbox_platform_plugin_register(std::unique_ptr< anbox::Platform > &&platform)
Register a platform plugin.
AnboxPlatformConfiguration holds platform configuration options which Anbox supplies to the platform ...
Definition: types.h:648
AnboxPlatformDescriptor provides information about the implemented platform.
Definition: types.h:654
#define ANBOX_PLATFORM_DESCRIPTOR_SECTION
A particular elf section that Anbox needs various information from the platform plugin to appear in.
Definition: types.h:39
#define ANBOX_PLATFORM_VERSION
Definition: version.h:28

A descriptor that describes the basic information of the platform plugin.

This macro enables registering and unregistering a platform plugin, adding an additional section which allows Anbox to mainly verify platform API version at plugin compiling time. It comes with a few necessary plugin information too, such as the vendor name. Every platform implementation has to instantiate a platform descriptor which declares the implemented platform plugin and describes the following things.

  • name: The name of the platform
  • vendor: The vendor name of the platform.
  • description: The description of the platform.

Definition at line 262 of file platform.h.