socket :: NativeTimeval :: defaultinit
socket :: NativeTimeval :: new
socket $ NativeTimeval :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
socket :: NativeTimeval :: defaultinit
core :: Object :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
socket :: NativeTimeval :: new
core :: Object :: output_class_name
Display class name on stdout (debug only).
# Time structure, with a microsecond resolution
extern class NativeTimeval `{ struct timeval* `}
new (seconds: Int, microseconds: Int) `{
struct timeval* tv = NULL;
tv = malloc(sizeof(struct timeval));
tv->tv_sec = seconds;
tv->tv_usec = microseconds;
return tv;
`}
# Number of seconds recorded
fun seconds: Int `{ return self->tv_sec; `}
# Number of microseconds recorded
fun microseconds: Int `{ return self->tv_usec; `}
# Destory `self`
fun destroy `{ free(self); `}
end
lib/socket/socket_c.nit:349,1--367,3