Create a public C++ API
This is the head issue related to the proposition of a new C++ API.
The main idea is as follow.
PDI::Data_Store:
- the core of PDI should be a PDI::Data_Storeclass,
- an instance of Data_Storeis accessible fromPDI::Contextby adata()member function,
- the Data_Storeclass is very similar to astd::unordered_map<std::string, PDI::Weak_Ref>,
- in addition, it is "observable", i.e. one can register to be notified when references are added/removed in it.
PDI::Weak_Ref/PDI::Shared_Ref/PDI::Shared_R_Ref/PDI::Shared_RW_Ref
- the PDI::Shared_Ref/PDI::Weak_Refclasses can be used outside of PDI, they behave similarly tostd::shared_ptr/std::weak_ptr,- 
PDI::Weak_Ref/PDI::Shared_Refcan not be directly dereferenced,
- when dereferenced, PDI::Shared_R_Refreturns a const pointer,
- when dereferenced, PDI::Shared_R_Refreturns a normal pointer,
 
- 
- these references implement locking:
- 
PDI::Shared_R_Refbehaves like astd::shared_lock,
- 
PDI::Shared_W_Refbehaves like astd::unique_lock,
 
- 
- the memory ownership of shared_refis weaker than that ofshared_ptr(see JavaSoftReference):- all reference types offer a release()member function similarly tostd::unique_ptr,
- the reclaim()variant release all reference to the exception of the current one,
- all reference types offer a callback mechanism to be notified before the referenced data is released,
 
- all reference types offer a 
- unlike their C++ counterpart, these references offer dynamic typing
- a type()member function is offered that returns aDatatypeto retrieve the type information,
- templated versions are offered so that the user doesn't have to cast the void*pointer on every use,
 
- a 
- TODO: add a word about metadata & type template system
g_user_ref:
- the unordered_map<string, std::unique_ptr<Ref_holder>> g_user_refglobal variable stores the user-side references of the C API users,
- 
Ref_holderis a base class that is specialized with versions holding any ofPDI::Weak_Ref/PDI::Shared_Ref/PDI::Shared_R_Ref/PDI::Shared_RW_Ref,
- 
Ref_holdercan always be converted to aPDI::Weak_Ref.
The C API behaviour is as follow:
- 
sharecreates a new reference and stores it both in the globalContextand ing_user_ref,
- 
accessgets a reference from the globalContextand store it ing_user_ref,
- 
releaseremoves the reference fromg_user_ref,
- 
reclaimcallsrelease()on the reference fromg_user_refand removes it.
In other words
void* my_data = //...
// this
PDI_share("name", ptr, PDI_INOUT);
// is equivalent to this
Shared_RW_Ref my_ref(ptr);
pdi.data["name"] = my_ref;
// and this
PDI_release("name");
// is equivalent to this
my_ref.~Shared_RW_Ref(); //< usually done automaticallyand
// this
PDI_access("name", *ptr, PDI_INOUT);
// is equivalent to this
Shared_RW_Ref my_ref = pdi.data["name"];
// and this
PDI_reclaim("name");
// is equivalent to this
my_ref.reclaim();
// or this
ptr = my_ref.release();Edited  by Julien Bigot