Classes | |
| class | Base |
| Base corestring manager class. More... | |
| class | Buffer |
| Variable size byte oriented string. More... | |
| class | Buffer16 |
| class | Buffer32 |
| class | Byte |
| Byte orientet base class. More... | |
| class | Static |
| Static byte oriented string manager. More... | |
| class | Static16 |
| class | Static32 |
Enumerations | |
| enum | t_type { cs_static, cs_buffer, cs_static16, cs_buffer16, cs_static32, cs_buffer32 } |
| Type of core string. More... | |
Variables | |
| FALCON_DYN_SYM Buffer | handler_buffer |
| FALCON_DYN_SYM Buffer16 | handler_buffer16 |
| FALCON_DYN_SYM Buffer32 | handler_buffer32 |
| FALCON_DYN_SYM Static | handler_static |
| FALCON_DYN_SYM Static16 | handler_static16 |
| FALCON_DYN_SYM Static32 | handler_static32 |
| const uint32 | npos = 0xFFFFFFFF |
| Invalid position for core strings. | |
Core strings cannot be virtual classes. This is because core strings may be polimorphic; some operations may change the very nature of core strings. In example, read-only static strings will be turned to memory buffers in case of write operations. Chunked strings may be turned into sequential buffers, and the other way around. Re-creating them with a new() operator would not provide a viable solution as all the other data must stay the same.
For this reason, a manager class hyerarcy is provided. Every core string has a manager, (which is actually a pointer to a pure-virtual class with no data), and every operation on a string is an inline call to the manager class. So, the string virtuality is externalized in the manager.
With a "standard" compiler optimization this is 100% equivalent to have a pointer to a table of function, but actually faster as the offset of the virtual table is calculated at compile time in every situation.
| enum Falcon::csh::t_type |
| FALCON_DYN_SYM Buffer Falcon::csh::handler_buffer |
| FALCON_DYN_SYM Buffer16 Falcon::csh::handler_buffer16 |
| FALCON_DYN_SYM Buffer32 Falcon::csh::handler_buffer32 |
| FALCON_DYN_SYM Static Falcon::csh::handler_static |
| FALCON_DYN_SYM Static16 Falcon::csh::handler_static16 |
| FALCON_DYN_SYM Static32 Falcon::csh::handler_static32 |
| const uint32 Falcon::csh::npos = 0xFFFFFFFF |
1.5.8