Changeset 1542 for XIOS/trunk/src/group_factory_impl.hpp
- Timestamp:
- 06/13/18 16:48:53 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/group_factory_impl.hpp
r591 r1542 9 9 10 10 template <typename U> 11 void CGroupFactory::AddGroup( boost::shared_ptr<U> pgroup,12 boost::shared_ptr<U> cgroup)11 void CGroupFactory::AddGroup(std::shared_ptr<U> pgroup, 12 std::shared_ptr<U> cgroup) 13 13 { 14 14 if (cgroup.get() == NULL || pgroup.get() == NULL ) 15 ERROR("CGroupFactory::AddGroup( boost::shared_ptr<U> pgroup, boost::shared_ptr<U> cgroup)",15 ERROR("CGroupFactory::AddGroup(std::shared_ptr<U> pgroup, std::shared_ptr<U> cgroup)", 16 16 << " pgroup or cgroup NULL !"); 17 17 if (!cgroup->hasId()) … … 25 25 26 26 template <typename U> 27 void CGroupFactory::AddChild( boost::shared_ptr<U> group,28 boost::shared_ptr<typename U::RelChild> child)27 void CGroupFactory::AddChild(std::shared_ptr<U> group, 28 std::shared_ptr<typename U::RelChild> child) 29 29 { 30 30 if (group.get() == NULL || child.get() == NULL ) 31 ERROR("CGroupFactory::AddGroup( boost::shared_ptr<U> pgroup, boost::shared_ptr<U> cgroup)",31 ERROR("CGroupFactory::AddGroup(std::shared_ptr<U> pgroup, std::shared_ptr<U> cgroup)", 32 32 << " pgroup or cgroup NULL !"); 33 33 if (!child->hasId()) … … 41 41 42 42 template <typename U> 43 boost::shared_ptr<U>44 CGroupFactory::CreateGroup( boost::shared_ptr<U> group, const StdString & id)43 std::shared_ptr<U> 44 CGroupFactory::CreateGroup(std::shared_ptr<U> group, const StdString & id) 45 45 { 46 46 CObjectFactory::SetCurrentContextId … … 48 48 if (id.size() == 0) 49 49 { 50 boost::shared_ptr<U> value = CObjectFactory::CreateObject<U>(CObjectFactory::GenUId<U>());50 std::shared_ptr<U> value = CObjectFactory::CreateObject<U>(CObjectFactory::GenUId<U>()); 51 51 group->groupList.insert(group->groupList.end(), value.get()); 52 52 group->groupMap.insert(std::make_pair(value->getId(), value.get())); … … 57 57 else 58 58 { 59 boost::shared_ptr<U> value = CObjectFactory::CreateObject<U>(id);59 std::shared_ptr<U> value = CObjectFactory::CreateObject<U>(id); 60 60 group->groupList.insert(group->groupList.end(), value.get()); 61 61 group->groupMap.insert(std::make_pair(id, value.get())); … … 65 65 66 66 template <typename U> 67 boost::shared_ptr<typename U::RelChild>68 CGroupFactory::CreateChild( boost::shared_ptr<U> group, const StdString & id)67 std::shared_ptr<typename U::RelChild> 68 CGroupFactory::CreateChild(std::shared_ptr<U> group, const StdString & id) 69 69 { 70 70 CObjectFactory::SetCurrentContextId … … 72 72 if (id.size() == 0) 73 73 { 74 boost::shared_ptr<typename U::RelChild> value =74 std::shared_ptr<typename U::RelChild> value = 75 75 CObjectFactory::CreateObject<typename U::RelChild>(); 76 76 group->childList.insert(group->childList.end(), value.get()); … … 82 82 else 83 83 { 84 boost::shared_ptr<typename U::RelChild> value =84 std::shared_ptr<typename U::RelChild> value = 85 85 CObjectFactory::CreateObject<typename U::RelChild>(id); 86 86 group->childList.insert(group->childList.end(), value.get()); … … 91 91 92 92 template <typename U> 93 bool CGroupFactory::HasGroup( boost::shared_ptr<U> group, const StdString & id)93 bool CGroupFactory::HasGroup(std::shared_ptr<U> group, const StdString & id) 94 94 { return (group->groupMap.find(id) != group->groupMap.end()); } 95 95 96 96 template <typename U> 97 bool CGroupFactory::HasChild( boost::shared_ptr<U> group, const StdString & id)97 bool CGroupFactory::HasChild(std::shared_ptr<U> group, const StdString & id) 98 98 { return (group->childMap.find(id) != group->childMap.end()); } 99 99 100 100 template <typename U> 101 int CGroupFactory::GetGroupNum( boost::shared_ptr<U> group)101 int CGroupFactory::GetGroupNum(std::shared_ptr<U> group) 102 102 { return (group->groupList.size()); } 103 103 104 104 template <typename U> 105 int CGroupFactory::GetGroupIdNum( boost::shared_ptr<U> group)105 int CGroupFactory::GetGroupIdNum(std::shared_ptr<U> group) 106 106 { return (group->groupMap.size()); } 107 107 108 108 template <typename U> 109 int CGroupFactory::GetChildNum( boost::shared_ptr<U> group)109 int CGroupFactory::GetChildNum(std::shared_ptr<U> group) 110 110 { return (group->childList.size()); } 111 111 112 112 template <typename U> 113 int CGroupFactory::GetChildIdNum( boost::shared_ptr<U> group)113 int CGroupFactory::GetChildIdNum(std::shared_ptr<U> group) 114 114 { return (group->childMap.size()); } 115 115 116 116 template <typename U> 117 boost::shared_ptr<U>118 CGroupFactory::GetGroup( boost::shared_ptr<U> group, const StdString & id)117 std::shared_ptr<U> 118 CGroupFactory::GetGroup(std::shared_ptr<U> group, const StdString & id) 119 119 { 120 120 if (!CGroupFactory::HasGroup<U>(group, id)) 121 ERROR("CGroupFactory::GetGroup( boost::shared_ptr<U> group, const StdString & id)",121 ERROR("CGroupFactory::GetGroup(std::shared_ptr<U> group, const StdString & id)", 122 122 << "[ id = " << id << ", U = " << U::GetName() << " ] " 123 123 << " group is not referenced !"); … … 126 126 127 127 template <typename U> 128 boost::shared_ptr<typename U::RelChild>129 CGroupFactory::GetChild( boost::shared_ptr<U> group, const StdString & id)128 std::shared_ptr<typename U::RelChild> 129 CGroupFactory::GetChild(std::shared_ptr<U> group, const StdString & id) 130 130 { 131 131 if (!CGroupFactory::HasChild<U>(group, id)) 132 ERROR("CGroupFactory::GetChild( boost::shared_ptr<U> group, const StdString & id)",132 ERROR("CGroupFactory::GetChild(std::shared_ptr<U> group, const StdString & id)", 133 133 << "[ id = " << id << ", U = " << U::GetName() << " ] " 134 134 << " child is not referenced !");
Note: See TracChangeset
for help on using the changeset viewer.