#
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 ...
|
#
a098a37a |
| 05-May-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
style: comply with OpenBMC style guidelines
Change-Id: I72f86c59a0502777c861de901907c0a556c4c6c5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
#
2352088e |
| 26-May-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
clang-format: update to OpenBMC latest
Ignore libmapper, because it is written in C and the CPP style guidelines are not appropriate.
Ignore subprojects; they can validate their formatting themselv
clang-format: update to OpenBMC latest
Ignore libmapper, because it is written in C and the CPP style guidelines are not appropriate.
Ignore subprojects; they can validate their formatting themselves.
Change-Id: Id88dcc49f4176c6443e7f53ca193ca8f3e83a51f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
#
7f8fd1fa |
| 08-Apr-2019 |
Matt Spinler <spinler@us.ibm.com> |
Add function to find assocs based on endpoint
The helper function findAssociations can find all associations based on an endpoint path and return enough information to recreate those associations la
Add function to find assocs based on endpoint
The helper function findAssociations can find all associations based on an endpoint path and return enough information to recreate those associations later.
For example, searching for something like "endpointA"
could return: owner: "ownerA" Association{"typeA", "typeB", "endpointB"}
Which implies the association: endpointA/typeA -> endpointB/typeB
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0fbcf5397435f10b3072dd2640b342ee47d52f9b
show more ...
|
#
cb9bcdb1 |
| 08-Apr-2019 |
Matt Spinler <spinler@us.ibm.com> |
Remove an endpoint from the pending assocs
If there is a pending association, but the object that owns that association goes off the bus, then there is no need to wait for the endpoint to show up an
Remove an endpoint from the pending assocs
If there is a pending association, but the object that owns that association goes off the bus, then there is no need to wait for the endpoint to show up anymore so remove it from the pending associations list.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I96af6ffd62f857015522c041dfbdbcd2132d8374
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 endpoint path. It's
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 ...
|
#
e2359fb7 |
| 05-Apr-2019 |
Matt Spinler <spinler@us.ibm.com> |
Gather association maps into a single structure
The AssociationOwners and AssociationIntefaces maps are passed around separately in the mapper, but usually they are always used together.
Gather the
Gather association maps into a single structure
The AssociationOwners and AssociationIntefaces maps are passed around separately in the mapper, but usually they are always used together.
Gather them into a structure to make it easier to write code to use them, especially because soon there will be another entry in it.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ibd5b622c7c1240ff8e23846368cbfd56e5bba24d
show more ...
|
#
35396c10 |
| 05-Apr-2019 |
Matt Spinler <spinler@us.ibm.com> |
Move common types into a common header
Upcoming commits will have code that references some of these types in more files so it makes sense to have them in a common place.
Signed-off-by: Matt Spinle
Move common types into a common header
Upcoming commits will have code that references some of these types in more files so it makes sense to have them in a common place.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I92adbefdd4bcfdb5d8d7e30b7fdf0fa03c739d2a
show more ...
|