integration ALLOW_SHARED_PTR_ONLY_CREATION in classes
added CHECK_GE to macros.h
fixed doc/example

Change-Id: Ieaf227691c712a1c4a1b1bd11f8c5169c6705482