Insert a new element with a key or update an existing element that matches the key. If root exists, reject

Return TypeFunction nameArguments
hzEcodehzNamering::AddRoot(hzString&,)

Declared in file: hzNamering.h
Defined in file : hzNamering.cpp

Function Logic:

0:START 1:unknown 2:Return E_ARGUMENT 3:items 4:unknown 5:rc 6:items items items 7:items 8:Return rc

Function body:

hzEcode hzNamering::AddRoot (hzString& root)
{
   //  Insert a new element with a key or update an existing element that matches the key.
   //  If root exists, reject
   //  
   //  Arguments: 1) root The root to add
   //  
   //  Returns: E_ARGUMENT If the supplied root name is blank
   //     E_DUPLICATE If a group with that root name already exists
   //     E_OK  If the group is added
   _hzfunc("hzNamering::AddRoot") ;
   hzEcode     rc = E_OK ;     //  Return code
   if (!root)
       return E_ARGUMENT ;
   mx->m_Lock.LockWrite() ;
   if (mx->m_Groups.Exists(root))
       rc = E_DUPLICATE ;
   else
   {
       mx->m_Groups.Insert(root) ;
       mx->m_Roots.Insert(root,root) ;
       mx->m_Members.Insert(root,root) ;
   }
   mx->m_Lock.Unlock() ;
   return rc ;
}