コード例 #1
0
ファイル: Reflected.cpp プロジェクト: cschladetsch/KAI
KAI_BEGIN

Registry &Reflected::Reg() const
{
    if (!Self || !Self->Exists())
        KAI_THROW_0(NullObject);

    return *Self->GetRegistry();
}
コード例 #2
0
ファイル: Registry.cpp プロジェクト: kalineh/KAI
void Registry::AddClass(const ClassBase *klass)
{
	if (klass == 0)
		KAI_THROW_0(NullObject);

	if (GetClass(klass->GetTypeNumber()))
		KAI_THROW_1(Base, "Duplicate Class");

	classes[klass->GetTypeNumber().ToInt()] = klass;
}
コード例 #3
0
ファイル: Continuation.cpp プロジェクト: cschladetsch/KAI
void Continuation::Enter(Executor *exec)
{
    if (code.Exists() && !code->Empty())
    {
        if (!scope.Exists())
            scope = exec->New<void>();

        Stack &data = *exec->GetDataStack();
        if (data.Size() < args->Size())
        {
            KAI_TRACE_ERROR_2(data.Size(), args->Size()) << "Failed to enter continuation: not enough args";
            KAI_THROW_0(EmptyStack);
        }

        for (auto arg : *args)
        {
            Object a = data.Pop();
            scope.Set(ConstDeref<Label>(arg), a);
        }
    }

    *index = 0;
}