Menu

how

somtoolkit

How does it work?

The core to understanding how SOM works is understanding the API somResolve(). This takes an object and a method token and returns the function pointer for the method.

There are variations, such as somParentNumResolve() used for super() calls, and somDataResolve() so an object can access it's instance data.

Method tokens are published in ClassData structures, giving clients ready access to the tokens.

Clients can also use somResolveByName() to lookup a method by name.

Finally a client can use SOMObject::somDispatch() which uses somApply() internally to call any method.

In order for somApply() to work, the SOM Compiler (SC) generates apply and redispatch stubs to convert arguments to and from va_list.

This is all managed at runtime by the SOM kernel which uses SOMClass objects to represent each active class, and SOMClassMgr to manage them.

The Win32 i386 32bit implementation goes a step further and uses assembler so the client can call the method token directly without having to call somResolve().


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.