.. _vnx.Object: vnx.Object ========== .. cpp:namespace:: vnx::Object `Object` represents an arbitrary object which is dynamically created and does not have a type. However an optional type name can be specified via a special field called ``__type``. Internally it is a map of ``string`` keys to :ref:`vnx.Variant` values. JSON ---- In JSON format an object is specified as follows: .. code-block:: javascript { "__type": "optional.type.name.here", "field": "value", "some": 1234, "array": [1, 2, 3, 4], "nested": { "example": "value", ... }, ... } Lua Script ---------- In Lua Script an object can be created as follows: .. code-block:: lua { field = "value", some = 1234, array = {1, 2, 3, 4}, nested = { example = "value", ... }, ... } Native C++ ---------- In native C++ an object can be created as follows: .. code-block:: cpp #include vnx::Object obj; obj["field"] = "value"; obj["some"] = 1234; obj["array"] = std::vector{1, 2, 3, 4}; vnx::Object nested; nested["example"] = "value"; obj["nested"] = nested; std::cout << obj << std::endl;