STL Singleton Template

Singleton is one of my favorite design pattern, I use it to keep a global information for my application such as Configurations, Logger etc. I remember I wrote a post regarding simple singleton class, which it does not really work as singleton. It is just a silly way to make a object class looks like singleton.

Lately I’ll been using STL Singleton template for my projects, I find it simple to implement and yet efficient.

Continue reading

How to embed Lua 5.1 in C++

Lua, is a scripting language providing dynamic data structures, maths, io and string manipulations just like any interprete language such as Bash, Python, Ruby etc.

What is so special about Lua?
Lua is Fast, Light-weight and Embeddable.

Lua can be embedded into c and c++ programs and Lua core are statically complied with your c++ programs, meaning your c++ program itself are now becoming Lua interpreter that execute Lua scripts. To extend your c++ application to execute Lua script is simple, lets check it out.

Continue reading