Ntk.Lib
Description:
Content:
Namespaces:
- Serializer -
- TaskletUtils - This module allows the
developer to use sockets API with a blocking-like style and makes sure that only the intended tasklet becomes blocked, not the whole
application.
Interfaces:
- ISerializable - The interface ISerializable
has to be implemented by any class whose instances we want to be able to serialize and transmit over the net. The class that we want to
be serializeable needs to know how to put in a Variant its data and retrieve it from a Variant. But the code that wants to serialize an
instance of those classes will use the methods serialize and deserialize, which treat simple uchar arrays.
Classes:
- Channel - A Channel object is used for bidirectional
communication between tasklets.
- Logger -
- TaskletDispatcher - The class
TaskletDispatcher is not meant to create instances. Its static method get_channel_for_helper is used to register an helper that will act
as a dispatcher for a function/method that we want to be executed once at a time in a dedicated tasklet.
- BufferOwner -
- SerializableNone - Return value for "void"
- SerializableInt - Serializable class for int
- SerializableBool - Serializable class for bool
- SerializableString - Serializable class for
string
- SerializableBuffer - Serializable class for
uint8[]
- ListString - Serializable class for List<string
>
- ListISerializable - Serializable class for
List<ISerializable>
- Tasklet - A Tasklet instance represents a thread that
has been spawned to execute a certain function. In order to spawn a thread to execute a method of an object proceed this way: | *
prepare a function, or a static method, with the signature void *(*)(void *) | * prepare a struct which will contain: | * the instance
of the class which the method is invoked in, | * the parameters (simple types or objects) that will be passed. | * in the function do
this: | * cast the void* to a pointer to your struct | * if you pass a ref-counted class, assign it to a local variable in order to
increase the refcounter | * if you pass a simple type, assign it to a local variable in order to copy its value | * call
Tasklet.schedule_back() in order to let the caller decide when to start the new thread | * call the method with the object and
parameters that you just copied in local variables | * when you want to spawn, allocate in the stack a struct of the type | * populate
the struct with data | * call Tasklet.spawn(function, &my_struct) The real function/method will not start immediately, but the
struct can be safely freed right now.
- Timer - Class for "timeouts" or "timespans"
- TimeCapsule - Serializable class for "timeouts" or
"timespans"
Error domains:
Functions: