Esempio n. 1
0
// ================================================================================================
void Register_SockAddr(Table & mmns)
{
    mmns.Bind(_SC("SockAddr"),
        Class< SockAddr, NoCopy< SockAddr > >(mmns.GetVM(), _SC("SqMMSockAddr"))
        // Constructors
        .Ctor()
        .Ctor< CSStr >()
        // Meta-methods
        .SquirrelFunc(_SC("_typename"), &SockAddr::Typename)
        .Func(_SC("_tostring"), &SockAddr::ToString)
        // Properties
        .Prop(_SC("IsValid"), &SockAddr::IsValid)
        .Prop(_SC("Address"), &SockAddr::GetAddress)
    );
}
Esempio n. 2
0
// ================================================================================================
void Register_LookupResult(Table & mmns)
{
    mmns.Bind(_SC("LookupResult"),
        Class< LookupResult >(mmns.GetVM(), _SC("SqMMLookupResult"))
        // Constructors
        .Ctor()
        .Ctor< const LookupResult & >()
        // Meta-methods
        .SquirrelFunc(_SC("_typename"), &LookupResult::Typename)
        .Func(_SC("_tostring"), &LookupResult::ToString)
        // Properties
        .Prop(_SC("IsValid"), &LookupResult::IsValid)
        .Prop(_SC("Database"), &LookupResult::GetDatabase)
        .Prop(_SC("References"), &LookupResult::GetRefCount)
        .Prop(_SC("FoundEntry"), &LookupResult::FoundEntry)
        .Prop(_SC("NetMask"), &LookupResult::GetNetMask)
        .Prop(_SC("EntryDataList"), &LookupResult::GetEntryDataList)
        // Member methods
        .Func(_SC("Release"), &LookupResult::Release)
        // Squirrel functions
        .SquirrelFunc(_SC("GetValue"), &LookupResult::GetValue)
    );
}