acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa__sort_map_impl.h
1#pragma once
2
3
4//
5//template < class KEY, class ARG_KEY, class PAYLOAD, class ARG_VALUE, class COMPARE, bool m_bMultiKey >
6//void sort_map < KEY,ARG_KEY,PAYLOAD,ARG_VALUE,COMPARE, m_bMultiKey >::add_pair(ARG_KEY key,ARG_VALUE newValue)
7//{
8//
9// if(m_pnode == nullptr)
10// {
11// m_pnode = aaa_primitive_new node(key,newValue);
12// return;
13// }
14//
15// node * pnode = m_pnode;
16//
17// while(true)
18// {
19// if(compare(key,pnode->element1()))
20// {
21//
22// if(pnode->left == nullptr)
23// {
24//
25// pnode->left = aaa_primitive_new node(key,newValue);
26//
27// return;
28//
29// }
30// else
31// {
32//
33// pnode = pnode->left;
34//
35// }
36//
37// }
38// else if(m_bMultiKey || compare(pnode->element1(), key))
39// {
40//
41// if(pnode->right == nullptr)
42// {
43//
44// pnode->right = aaa_primitive_new node(key, newValue);
45//
46// return;
47//
48// }
49// else
50// {
51//
52// pnode = pnode->right;
53//
54// }
55//
56// }
57// else
58// {
59//
60// pnode->element2() = newValue;
61//
62// return;
63//
64// }
65//
66// }
67//
68//
69//}
70//
71//
72//template < class KEY,class ARG_KEY,class PAYLOAD,class ARG_VALUE,class COMPARE, bool m_bMultiKey >
73//void sort_map < KEY,ARG_KEY,PAYLOAD,ARG_VALUE,COMPARE, m_bMultiKey >::insert(const pair < KEY,PAYLOAD > & pair)
74//{
75//
76// add_pair(pair.element1(),pair.element2());
77//
78//}
79//
80//
81//template < class type_map >
82//sort_attrib_map < type_map > & sort_attrib_map < type_map >::operator = (const sort_attrib_map & attribmap)
83//{
84//
85// if(this != &attribmap)
86// {
87//
88// this->erase_all();
89//
90// typename type_map::pair * ppair;
91//
92// for(::collection::index i = 0; i < attribmap.m_ptra.get_count(); i++)
93// {
94//
95// ppair = aaa_primitive_new typename type_map::pair(attribmap.m_ptra[i]->element1());
96//
97// ppair->element2() = attribmap.m_ptra[i]->element2();
98//
99// this->m_ptra.add(ppair);
100//
101// }
102//
103// }
104//
105// return *this;
106//
107//}