#
964681ca |
| 08-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Modernize mapper core types
There's a number of best practices that have evolved in our use of flat_maps and flat_sets since this code was originally written.
First, add std::less<> to the Compare
Modernize mapper core types
There's a number of best practices that have evolved in our use of flat_maps and flat_sets since this code was originally written.
First, add std::less<> to the Compare template argument. The default for this is std::less<Key> which limits find() calls (and any lookup for that matter) to only supporting std::string. Using std::less<> allows lookup by std::string_view, which can prevent some copies in some cases.
Next, add std::vector<...> to the types under the AllocatorOrContainer template arg. Per our coding standard, this overrides the default of using boost::vector, and replaces it with std::vector, which, although it has a very similar interface, tends to optimize better, and be better supported overall.
The rest of this patch updates a couple places where the various types were specifically hardcoded, so it moves to using the various using declarations.
Tested: Unit tests; Next patch tests this more fully.
Change-Id: I11e8ecb669f31193c55dda344b25d3fa5d191502 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
e0b0e3a2 |
| 08-Apr-2019 |
Matt Spinler <spinler@us.ibm.com> |
Check for missing endpoints when adding assocs An association links 2 D-Bus object paths together, one which is the path that has the original associations property, and another endp
Check for missing endpoints when adding assocs An association links 2 D-Bus object paths together, one which is the path that has the original associations property, and another endpoint path. It's possible that that endpoint path doesn't exist on D-Bus when that associations property is created. This commit, along with upcoming ones, adds support to not create the actual association object paths until that endpoint path shows up on D-Bus. In addition, if that endpoint path were to get removed from D-Bus in the future, then the association paths should be removed until that path is back again. This particular commit introduces the PendingAssociations map to track these cases, and adds support in the associationChanged path to add associations to this map if the endpoint path isn't on D-Bus instead of just blindly creating the association objects. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I1f4bf0e02bf7a350d9e3f18c3591737289a51a39
show more ...
|
#
2067926a |
| 11-Feb-2019 |
Andrew Geissler <geissonator@yahoo.com> |
unit-test: Test deleting entry on name change Breaking off into a separate function enables easier unit testing of the specific function Testing: 97% coverage of processing.cpp
unit-test: Test deleting entry on name change Breaking off into a separate function enables easier unit testing of the specific function Testing: 97% coverage of processing.cpp Change-Id: I08f229657a8f44230b711fabbae20fb403792637 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
#
bb7b592e |
| 08-Feb-2019 |
Andrew Geissler <geissonator@yahoo.com> |
unit-test: Move association create funcs to util These will be useful in other test suites so move into util directory Change-Id: Ibea5c417e38210e6e1388cf4492af10a64db9077 Signe
unit-test: Move association create funcs to util These will be useful in other test suites so move into util directory Change-Id: Ibea5c417e38210e6e1388cf4492af10a64db9077 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|