From Onda Technology Institute Wiki
Jump to: navigation, search

JamLib is a class library for C++. It is one of the most important published projects being developed by the Onda Technology Institute. It has been under slow, but steady development for several years. This project was started when the team felt the need for a low level API, which had to be operating system independent, to support some "by-contract" projects. It was also important that it had as little dependencies on third party elements as possible and that it was able to provide an environment as complete as possible. We are focusing on trying to bring to C++ the same diversity in functionality of the standard class libraries of the .Net and Java platforms. This library has an excellent implementation and groundbreaking performance, tuned to the finest detail, therefore aiming for a high level of consistency, ease of use and safety. JamLib is undergoing some rewriting and code refining to prepare it for current needs of developers/users and make it more third-party friendly. It is based upon several different modules, described below, each with a specific context.

JL's source code may eventually be made available to the general public, when it is determined to have reached satisfactory state of development.


JamLib provides you with its own types, including some predictable-size numeric types. POD types are "Plain Old Data" types, meaning they are pure types.

Type name Size C/C++ equivalent Description
SmallInt 8 bits char POD Type
ShortInt 16 bits short int POD Type
LongInt 32 bits long int POD Type
HugeInt 64 bits long long int / __int64 POD Type
Float float POD Type
Double double POD Type

Class universe

  • JamLib::ADebugAssistant - Abstract class: implementation of code tracing/debugging methods;
  • JamLib::AMessageProvider - Abstract class: automated management of text strings during runtime, facilitated locale handling;
  • JamLib::Base - Header file: specification of base macros, types and other dependencies, globally used throughout JamLib;
  • JamLib::CLib - Regular class: multi-platform implementation of dynamic library and shared object loading;
  • JamLib::CVarArg - Regular class: allows for the creation of variable-argument functions with inferable types;
  • JamLib::Class - Abstract class: standardization for all classes used/implemented under the JL framework;
  • JamLib::DebugAssistantConsole - Regular class: console JamLib::ADebugAssistant implementation;
  • JamLib::Event - Regular class: event (and event set) management for JL-based projects;
  • JamLib::EventArgs - Regular class: base class for processing parameters of event handlers;
  • JamLib::EventHandler - Regular class: implementation of event handlers (associated to an event);
  • JamLib::Exceptions - Regular class: exceptions definition API;
  • JamLib::ExceptionMacros - Macro set: multi-level exception tracing behavior definitions for thrown Exceptions;
  • JamLib::FlagSet - Regular class: binary parameters manager for application-specific methods/functions;
  • JamLib::IEventHandler - Interface: base class implementation for EventHandler classes;
  • JamLib::ISeekable - Interface: base class for random-access seekable data providers;
  • JamLib::JamLib - Everything: the love of my life;
  • JamLib::TBuffer - Type: definition of JL's custom buffer data type along with its operational methods;
  • JamLib::TCString - Type: custom C-string type definition with operator overloading;
  • JamLib::TNumeric - Type: numeric data types definition and processing routines;
  • JamLib::TString - Type: definition for generic string types and methods for comparisons and processing;
  • JamLib::Type - Regular class: base class for the distinct Type derivatives (i.e.: TString, TNumeric, etc).



  • If you are developing for JL, it is MANDATORY to follow the guidelines and code style on this book.

General information about using JamLib

  • RTTI: Currently, JamLib cannot be compiled without RTTI (run-time type information). For example, with GCC you CANNOT use -fno-rtti. Compiling without RTTI will break the framework because of heavy reliance on multiple inheritance, dynamic casts and signals. You have been warned.


  • Develop a tool to help dealing with the several different JamLib modules and that allows to build tailored dynamic libraries with only the modules used by a certain project;
  • File JamLib::GenericMacros, JamLib::Exeptions and JamLib::TStringComparisons under the appropriate class context;
  • Decide on whether CString builder is a "standalone" class or should be integrated in JamLib::TString;
  • Implement JamLib::Math class (possibly converting it into a module);
  • Implement(?) JamLib::Operators class;
  • Review BinaryReader, BinaryWriter and TPascalString classes;
  • Expand JamLib::Console module's functionality;
  • Approve class universe and module list sections.

Code cleanup

Look for the following items:

  • TODO
  • POKE
  • DOC