mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-05 17:46:56 +00:00
Minor doc updates: FlexBuffers C#, Discord, CppUsage.
Change-Id: Ie34ff580eb2f41ff35f85271b10865f4a14d0dca
This commit is contained in:
@@ -114,7 +114,7 @@ To use:
|
|||||||
MonsterT monsterobj;
|
MonsterT monsterobj;
|
||||||
|
|
||||||
// Deserialize from buffer into object.
|
// Deserialize from buffer into object.
|
||||||
UnPackTo(&monsterobj, flatbuffer);
|
GetMonster(flatbuffer)->UnPackTo(&monsterobj);
|
||||||
|
|
||||||
// Update object directly like a C++ class instance.
|
// Update object directly like a C++ class instance.
|
||||||
cout << monsterobj->name; // This is now a std::string!
|
cout << monsterobj->name; // This is now a std::string!
|
||||||
@@ -122,7 +122,7 @@ To use:
|
|||||||
|
|
||||||
// Serialize into new flatbuffer.
|
// Serialize into new flatbuffer.
|
||||||
FlatBufferBuilder fbb;
|
FlatBufferBuilder fbb;
|
||||||
Pack(fbb, &monsterobj);
|
fbb.Finish(Monster::Pack(fbb, &monsterobj));
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following attributes are specific to the object-based API code generation:
|
The following attributes are specific to the object-based API code generation:
|
||||||
@@ -567,15 +567,15 @@ a specific locale use the environment variable `FLATBUFFERS_TEST_LOCALE`:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Support of floating-point numbers
|
## Support of floating-point numbers
|
||||||
The Flatbuffers library assumes that a C++ compiler and a CPU are
|
The Flatbuffers library assumes that a C++ compiler and a CPU are
|
||||||
compatible with the `IEEE-754` floating-point standard.
|
compatible with the `IEEE-754` floating-point standard.
|
||||||
The schema and json parser may fail if `fast-math` or `/fp:fast` mode is active.
|
The schema and json parser may fail if `fast-math` or `/fp:fast` mode is active.
|
||||||
|
|
||||||
### Support of hexadecimal and special floating-point numbers
|
### Support of hexadecimal and special floating-point numbers
|
||||||
According to the [grammar](@ref flatbuffers_grammar) `fbs` and `json` files
|
According to the [grammar](@ref flatbuffers_grammar) `fbs` and `json` files
|
||||||
may use hexadecimal and special (`NaN`, `Inf`) floating-point literals.
|
may use hexadecimal and special (`NaN`, `Inf`) floating-point literals.
|
||||||
The Flatbuffers uses `strtof` and `strtod` functions to parse floating-point
|
The Flatbuffers uses `strtof` and `strtod` functions to parse floating-point
|
||||||
literals. The Flatbuffers library has a code to detect a compiler compatibility
|
literals. The Flatbuffers library has a code to detect a compiler compatibility
|
||||||
with the literals. If necessary conditions are met the preprocessor constant
|
with the literals. If necessary conditions are met the preprocessor constant
|
||||||
`FLATBUFFERS_HAS_NEW_STRTOD` will be set to `1`.
|
`FLATBUFFERS_HAS_NEW_STRTOD` will be set to `1`.
|
||||||
The support of floating-point literals will be limited at compile time
|
The support of floating-point literals will be limited at compile time
|
||||||
@@ -583,26 +583,26 @@ if `FLATBUFFERS_HAS_NEW_STRTOD` constant is less than `1`.
|
|||||||
In this case, schemas with hexadecimal or special literals cannot be used.
|
In this case, schemas with hexadecimal or special literals cannot be used.
|
||||||
|
|
||||||
### Comparison of floating-point NaN values
|
### Comparison of floating-point NaN values
|
||||||
The floating-point `NaN` (`not a number`) is special value which
|
The floating-point `NaN` (`not a number`) is special value which
|
||||||
representing an undefined or unrepresentable value.
|
representing an undefined or unrepresentable value.
|
||||||
`NaN` may be explicitly assigned to variables, typically as a representation
|
`NaN` may be explicitly assigned to variables, typically as a representation
|
||||||
for missing values or may be a result of a mathematical operation.
|
for missing values or may be a result of a mathematical operation.
|
||||||
The `IEEE-754` defines two kind of `NaNs`:
|
The `IEEE-754` defines two kind of `NaNs`:
|
||||||
- Quiet NaNs, or `qNaNs`.
|
- Quiet NaNs, or `qNaNs`.
|
||||||
- Signaling NaNs, or `sNaNs`.
|
- Signaling NaNs, or `sNaNs`.
|
||||||
|
|
||||||
According to the `IEEE-754`, a comparison with `NaN` always returns
|
According to the `IEEE-754`, a comparison with `NaN` always returns
|
||||||
an unordered result even when compared with itself. As a result, a whole
|
an unordered result even when compared with itself. As a result, a whole
|
||||||
Flatbuffers object will be not equal to itself if has one or more `NaN`.
|
Flatbuffers object will be not equal to itself if has one or more `NaN`.
|
||||||
Flatbuffers scalar fields that have the default value are not actually stored
|
Flatbuffers scalar fields that have the default value are not actually stored
|
||||||
in the serialized data but are generated in code (see [Writing a schema](@ref flatbuffers_guide_writing_schema)).
|
in the serialized data but are generated in code (see [Writing a schema](@ref flatbuffers_guide_writing_schema)).
|
||||||
Scalar fields with `NaN` defaults break this behavior.
|
Scalar fields with `NaN` defaults break this behavior.
|
||||||
If a schema has a lot of `NaN` defaults the Flatbuffers can override
|
If a schema has a lot of `NaN` defaults the Flatbuffers can override
|
||||||
the unordered comparison by the ordered: `(NaN==NaN)->true`.
|
the unordered comparison by the ordered: `(NaN==NaN)->true`.
|
||||||
This ordered comparison is enabled when compiling a program with the symbol
|
This ordered comparison is enabled when compiling a program with the symbol
|
||||||
`FLATBUFFERS_NAN_DEFAULTS` defined.
|
`FLATBUFFERS_NAN_DEFAULTS` defined.
|
||||||
Additional computations added by `FLATBUFFERS_NAN_DEFAULTS` are very cheap
|
Additional computations added by `FLATBUFFERS_NAN_DEFAULTS` are very cheap
|
||||||
if GCC or Clang used. These compilers have a compile-time implementation
|
if GCC or Clang used. These compilers have a compile-time implementation
|
||||||
of `isnan` checking which MSVC does not.
|
of `isnan` checking which MSVC does not.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ sections provide a more in-depth usage guide.
|
|||||||
- [GitHub repository](http://github.com/google/flatbuffers)
|
- [GitHub repository](http://github.com/google/flatbuffers)
|
||||||
- [Landing page](http://google.github.io/flatbuffers)
|
- [Landing page](http://google.github.io/flatbuffers)
|
||||||
- [FlatBuffers Google Group](https://groups.google.com/forum/#!forum/flatbuffers)
|
- [FlatBuffers Google Group](https://groups.google.com/forum/#!forum/flatbuffers)
|
||||||
|
- [Discord](https://discord.gg/6qgKs3R) and [Gitter](https://gitter.im/lobster_programming_language/community) chat.
|
||||||
- [FlatBuffers Issues Tracker](http://github.com/google/flatbuffers/issues)
|
- [FlatBuffers Issues Tracker](http://github.com/google/flatbuffers/issues)
|
||||||
- Independent implementations & tools:
|
- Independent implementations & tools:
|
||||||
- [FlatCC](https://github.com/dvidelabs/flatcc) Alternative FlatBuffers
|
- [FlatCC](https://github.com/dvidelabs/flatcc) Alternative FlatBuffers
|
||||||
@@ -178,3 +179,6 @@ sections provide a more in-depth usage guide.
|
|||||||
- [FlatBuffers in Android](http://frogermcs.github.io/flatbuffers-in-android-introdution/)
|
- [FlatBuffers in Android](http://frogermcs.github.io/flatbuffers-in-android-introdution/)
|
||||||
- [Parsing JSON to FlatBuffers in Java](http://frogermcs.github.io/json-parsing-with-flatbuffers-in-android/)
|
- [Parsing JSON to FlatBuffers in Java](http://frogermcs.github.io/json-parsing-with-flatbuffers-in-android/)
|
||||||
- [FlatBuffers in Unity](http://exiin.com/blog/flatbuffers-for-unity-sample-code/)
|
- [FlatBuffers in Unity](http://exiin.com/blog/flatbuffers-for-unity-sample-code/)
|
||||||
|
- [FlexBuffers C#](https://github.com/mzaks/FlexBuffers-CSharp) and
|
||||||
|
[article](https://medium.com/@icex33/flexbuffers-for-unity3d-4d1ab5c53fbe?)
|
||||||
|
on its use.
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
 FlatBuffers
|
 FlatBuffers
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
[](https://travis-ci.org/google/flatbuffers)
|
||||||
|
[](https://ci.appveyor.com/project/gwvo/flatbuffers)
|
||||||
[](https://gitter.im/google/flatbuffers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://gitter.im/google/flatbuffers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
[](https://travis-ci.org/google/flatbuffers) [](https://ci.appveyor.com/project/gwvo/flatbuffers)
|
[](https:///discord.gg/6qgKs3R)
|
||||||
|
[](https://twitter.com/wvo)
|
||||||
|
|
||||||
|
|
||||||
**FlatBuffers** is a cross platform serialization library architected for
|
**FlatBuffers** is a cross platform serialization library architected for
|
||||||
maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
|
maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
|
||||||
|
|||||||
Reference in New Issue
Block a user