スキル一覧に戻る
mgreenly

patternsvtable

by mgreenly

An AI Coding Agent

1🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: patterns/vtable description: Vtable Pattern (C-Specific) pattern for C development

Vtable Pattern (C-Specific)

Struct of function pointers enabling polymorphism. Different implementations provide different function pointer sets. Callers invoke through vtable.

ikigai Application

LLM providers:

typedef struct {
    res_t (*send)(void *impl, ...);
    res_t (*stream)(void *impl, ...);
    void (*cleanup)(void *impl);
} ik_provider_vtable_t;

typedef struct {
    ik_provider_vtable_t *vt;
    void *impl;  // OpenAI ctx, Anthropic ctx, etc.
} ik_llm_client_t;

Layer system: Each layer type provides render/resize functions.

Benefits:

  • Runtime polymorphism without inheritance
  • Swap implementations transparently
  • Mock implementations for testing

Convention: Vtable struct named *_vtable_t, instance holds vt pointer plus impl context.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です