Development reference: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
! c++11 Model View Controller skeleton | ! c++11 Model View Controller skeleton | ||
|- | |- | ||
| Three objects contain most of the functionality. In addition, utilities.* | | Three objects contain most of the functionality. In addition, utilities.* provides crosscut features like global logging. | ||
CONTROLLER header | CONTROLLER header | ||
Line 34: | Line 34: | ||
! c++11 containers | ! c++11 containers | ||
|- | |- | ||
| sorted_vector || use when doing lots of unsorted insertions and maintaining constant sort would be expensive; | | sorted_vector || use when doing lots of unsorted insertions and maintaining constant sort would be expensive; vector is good for a big pile of things that only occasionally needs a sorted lookup | ||
|- | |- | ||
| map || sorted binary search tree; always sorted by key; you can walk through in sorted order (choose unordered if not needed!) | | map || sorted binary search tree; always sorted by key; you can walk through in sorted order (choose unordered if not needed!) | ||
Line 49: | Line 49: | ||
This changes the constness of the object from binary (completely const) to logical (constness is defined by the developer).<br /> | This changes the constness of the object from binary (completely const) to logical (constness is defined by the developer).<br /> | ||
So... set is an excellent way to achieve both encapsulation and logical const - make const work for you, not against! :-)<br /> | So... set is an excellent way to achieve both encapsulation and logical const - make const work for you, not against! :-)<br /> | ||
|- | |||
| set (etc.) of pointers || sets of pointers are the pinnacle of object stores<br /> | |||
The entire object can be dereferenced and accessed then without const issues.<br /> | The entire object can be dereferenced and accessed then without const issues.<br /> | ||
A pointer functor can be provided that does a sort by dereferencing the pointer to the object.<br /> | |||
Two requirements: you must make sure yourself that you do not change the key values - you can mark them const, provided in constructor;<br /> | Two requirements: you must make sure yourself that you do not change the key values - you can mark them const, provided in constructor;<br /> | ||
you must create sort/equal/hash functors that dereference the pointers to use object contents<br /> | you must create sort/equal/hash functors that dereference the pointers to use object contents<br /> |
Revision as of 14:04, 30 April 2015
Expandc++11 Model View Controller skeleton |
---|
Expandc++11 containers |
---|
Expandc++11 example for large groups of objects with frequent crud AND search |
---|
Expandc++11 example for large groups of objects with infrequent crud and frequent search |
---|
Expandc++11 example to associate two complex objects (one the map key, one the map value) |
---|
Expandc++11 example for multiple unordered_set indexes into one group of objects |
---|
Expandc++11 example for set with specific sorting |
---|
Expandc++11 loop through vector to erase some items |
---|
Expandc++11 for loop using lambda |
---|
Expandc++11 integer types |
---|
Expandc++ in-memory storage of "major" objects |
---|
Expandc++ stl reverse iterator skeleton |
---|
Expandc++ stl reading a binary file into a string |
---|
Expandc/c++ gdb debugging |
---|
ExpandC - Create a portable command line C project in Visual Studio |
---|
Expandc++ Create a portable C++ project in Visual Studio |
---|
Expandboost build for both 32 and 64 bit Windows |
---|
Expandphp debugging |
---|
Expandeclipse settings |
---|
Expandeclipse java project layout format |
---|
Expandeclipse new project from existing code |
---|
Expandemacs configuration |
---|
ExpandSQL Server 2008+ proper upsert using MERGE |
---|
Expandgit use kdiff3 as difftool and mergetool |
---|
Expandgit create merge-to command |
---|
Expandgit shared repo |
---|
Expandgit create new branch on server, pull to client |
---|
Expandgit windows configure notepad++ editor |
---|
Expandgit pull when untracked files are in the way |
---|
Expandgit create new branch when untracked files are in the way |
---|
Expandgit fix push behavior - ONLY PUSH CURRENT doh |
---|
Expandgit recreate repo |
---|
Expandgit connect to origin after the fact |
---|
ExpandWindows command prompt FULL SCREEN |
---|
Expandbash chmod dirs |
---|
Web Services |
---|
Firefox Addon development |
---|
Expandmediawiki collapsible skeleton |
---|
Expandmediawiki collapsible example |
---|