Cleanup (indentation, comments) for non-const global support

@Zoomulator - I pulled in your non-const global commits.
This commit is contained in:
Jason Turner 2013-11-27 08:19:26 -07:00
parent d5fef3121a
commit a26d628e5c
2 changed files with 10 additions and 2 deletions

View File

@ -478,7 +478,10 @@ namespace chaiscript
}
void add_global(const Boxed_Value &obj, const std::string &name)
/**
* Adds a new global (non-const) shared object, between all the threads
*/
void add_global(const Boxed_Value &obj, const std::string &name)
{
validate_object_name(name);

View File

@ -454,7 +454,12 @@ namespace chaiscript
return *this;
}
ChaiScript &add_global(const Boxed_Value &t_bv, const std::string &t_name)
/// \brief Adds a mutable object that is available in all contexts and to all threads
/// \param[in] t_bv Boxed_Value to add as a global
/// \param[in] t_name Name of the value to add
/// \warning The user is responsible for making sure the object is thread-safe if necessary
/// ChaiScript is thread-safe but provides no threading locking mechanism to the script
ChaiScript &add_global(const Boxed_Value &t_bv, const std::string &t_name)
{
m_engine.add_global(t_bv, t_name);
return *this;