Commit Graph

38 Commits

Author SHA1 Message Date
Roland Winklmeier
38b00e06b3 refs #403 Add Policy::MetaType::None for base class templates 2015-05-05 21:34:14 +02:00
Roland Winklmeier
f71e0a89fb Make CContainerBase::compare public
This workarounds a cppcheck warning. The method was not unused,
but cppcheck was complaining.
2015-04-03 11:39:54 +02:00
Mathew Sutcliffe
9977d97a67 refs #356 Renamed CValueObjectStdTuple to CValueObject. 2015-03-27 23:03:25 +00:00
Mathew Sutcliffe
a5e6b31c0f refs #356 Update remaining CValueObject derived classes to use CValueObjectStdTuple instead. 2015-03-27 19:08:53 +00:00
Mathew Sutcliffe
31c33b4b8d refs #356 Removed CValueObject and expanded CValueObjectStdTuple to compensate.
* Involves rearranging some header includes to break cyclic include dependencies,
* Adding a new, simple base class CEmpty,
* Removing any remaining polymorphic uses of CValueObject with templates,
* Adding a new trait for use with enable_if to restrict templates to work only with value objects,
* Replacing the polymorphic/runtime multimethod-based compare functions with static/compile-time compare functions.
2015-03-27 19:08:51 +00:00
Mathew Sutcliffe
d8d361a317 refs #247 Improved CSequence comparison, and suppressed stupid warnings. 2014-12-13 01:38:49 +00:00
Mathew Sutcliffe
e3446d78d8 refs #336 Style and const-correctness. 2014-10-15 01:46:34 +01:00
Klaus Basan
31646b91f6 refs #330, relevant predicate-based container mutator methods now return the number of elements they modified. 2014-10-07 13:10:34 +02:00
Klaus Basan
4b50134d2a refs #325, refs #330 fixed apply method to return list of changed properties
* changed CValueObject apply
* created CIndexPropertyList
* renamed CIndexVariantMap to CPropertyIndexVariantMap
2014-10-07 13:10:33 +02:00
Klaus Basan
c1895c1ab2 refs #314, fixed missing virtual keyword and Doxygen comment 2014-08-25 13:10:13 +02:00
Klaus Basan
40b428a315 refs #314, renamed convertFromQVariant, convertFromJson
discussion: https://dev.vatsim-germany.org/issues/314#note-19
2014-08-24 02:47:16 +02:00
Klaus Basan
290abe3693 refs #314, fromQVariant / location of toQVariant
* renamed fromQVariant to convertFromQVariant, the "from" methods imply the object is changed (fromJson, fromString ..)
* implemented fromQVariant - changing the object by QVariant
* moved toQVariant into PQ template
* free function setFromQVariant
2014-08-24 02:47:05 +02:00
Klaus Basan
3fb5087ea8 Renaming, header, Doxygen, formatting (during refs #314) 2014-08-24 02:45:52 +02:00
Mathew Sutcliffe
101c5a4f98 refs #290 using a CRange of iterator adaptors to return from the primary predicate-based methods of CRangeBase without copying elements 2014-07-13 20:30:20 +01:00
Mathew Sutcliffe
32e3c0298c refs #290 Preparatory to adding CRange, refactored all const algorithm-based methods from CContainerBase into a common base class CRangeBase 2014-07-13 20:30:16 +01:00
Mathew Sutcliffe
e23e418797 incidental refactoring: simplify some predicates by templating their call operators 2014-07-13 00:45:22 +01:00
Mathew Sutcliffe
482ddf2081 fixes #285 removing fake variadics in predicate-based container methods 2014-07-04 11:41:44 +02:00
Roland Winklmeier
d46c5edb9f Generic CDictionary as associative container
refs #281
2014-07-04 11:41:44 +02:00
Klaus Basan
e474671ead refs #207, renamed CValueMap to CIndexVariantMap.
* The map will be used with CSimulaorInfo to transfer a variable number of setting information about the flight simulator. It is being used, because it is already DBus and tupel compliant. The new name better fits its purpose.
* Add == operator for CIndexVariantMap (ambiguity error with tupels)
2014-04-17 00:10:04 +02:00
Klaus Basan
87e4267872 Slightly improved version of compareImpl in containerbase.h 2014-03-26 20:18:49 +01:00
Klaus Basan
88fb9e8832 refs #192, enable value objects for JSON:
* from/toJson methods
* jsonMembers where applicable
2014-03-26 20:18:42 +01:00
Klaus Basan
8208e5858a refs #146 , using ", " in convertToQString -> better readability and word wrap 2014-02-26 03:44:33 +01:00
Mathew Sutcliffe
a5d8f6c8f0 refs #91 fixed \copydoc commands in Doxygen comments for CContainerBase 2014-02-08 15:01:59 +00:00
Klaus Basan
526cd916a8 refs #91 & #124 doxygen fixes, style/comment changes, typos, and override keywords 2014-02-06 03:22:42 +01:00
Mathew Sutcliffe
f8780d0075 fixes #114 incorrect iterator increment in for loop in CContainerBase::removeIf 2014-02-02 16:34:17 +00:00
Mathew Sutcliffe
c27da2e38a refs #108, added CContainerBase::to, for converting between different container types 2014-01-28 20:30:50 +00:00
Mathew Sutcliffe
7c8aa8226d const corrections 2014-01-28 20:19:06 +00:00
Mathew Sutcliffe
d48d8ed951 refs #106, moved removeIf from CSequence to CContainerBase and added remove method in CCollection (CSequence already had a remove method) 2014-01-28 18:30:06 +00:00
Mathew Sutcliffe
1e153b45f0 refs #108, added find methods in CSequence and CCollection;
CSequence uses std::find, and CCollection uses the more efficient find method of the implementation type,
which requires that the implementation type be an associative container like QSet or std::set.
Modified CContainerBase::contains to use these new find methods.
2014-01-28 18:25:14 +00:00
Mathew Sutcliffe
d073681630 minor doxygen fixes 2014-01-28 01:50:30 +00:00
Mathew Sutcliffe
6f19d0a479 containers: added methods contains(), remove(), replace(), replaceOrAdd(),
corresponding to contains(), removeIf(), replaceIf(), and replaceOrAdd(), but overloaded for const T& as well as for predicates.
refs #106
2014-01-25 19:36:42 +00:00
Mathew Sutcliffe
33d555e151 moved removeIf from CContainerBase to CSequence because it can't work with non-sequential containers, fixes #106 2014-01-25 19:36:42 +00:00
Mathew Sutcliffe
3d3a43602f removed unnecessary \param and \return lines from doxygen comments for container classes, refs #91 2014-01-25 19:36:41 +00:00
Klaus Basan
f883babc20 Only Doxygen fixes in order to answer
https://dev.vatsim-germany.org/boards/22/topics/1417?r=1432#message-1432

Fixed some Doxygen warnings along with it
No code changes!
2014-01-17 22:53:37 +01:00
Mathew Sutcliffe
db4c05dd9f refs #84 removed the CValueObject::compare method and added a friend function BlackMisc::compare to replace it.
The new compare is implemented using "multimethods" described in the book Advanced C++ Programming Styles and Idioms by James Coplien.

First, the isA method is used to determine which of the values being compared is the most general. (For example, CLength is more general than CAltitude.)
Then the compareImpl method is called on the most general value, with the other value as an argument.
If there is not a direct inheritance relation between the two values (or they are the same class) then the comparison is invalid and a assert is triggered.
2014-01-17 01:38:27 +00:00
Roland Winklmeier
05c121b214 Fixed a mistake where CContainerBase::marshallToDbus was using the wrong version of QDBusArgument::beginArray,
leading to the qdbuscpp2xml error "read from a write-only object" reported by Klaus.
2014-01-11 16:58:32 +00:00
Mathew Sutcliffe
08e978c8d6 moved from CContainerBase to CSequence those methods which only support sequential containers
refs #81
2014-01-10 00:20:21 +00:00
Mathew Sutcliffe
a57e640398 generic type-erased container types CSequence and CCollection, including predicate-based algorithms
refs #81
2014-01-08 00:59:31 +00:00