Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

RouterInfo: various refactoring #621

Merged
merged 8 commits into from
Apr 17, 2017
Merged

Conversation

anonimal
Copy link
Collaborator

@anonimal anonimal commented Apr 14, 2017

WIP. Live tests pass. Referencing #617. This WIP is in pursuit of isolating #187.

Note for any reviewers: if skimming through the GitHub "Files Changed" tab, a clickable "Large diffs are not loaded by default" for router/info.cc is tucked into the diff.

Edit: referencing #627


By submitting this pull-request, I confirm the following:

  • I have read and understood the Contributing Guide.
  • I have checked that another pull-request for this purpose does not exist.
  • I have considered and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used and that this pull-request may be closed by the will of the maintainer.
  • I give this submission freely under the BSD 3-clause license.

Related refactoring + access with scope operator for clarity
(enums are still unscoped)
Now accessible as RI trait.
- Pulls getters out of nested classes and into enclosed class

- Implements RI traits in place of hard-coded strings
  * also added cost + date RI trait

- Logs a definitive delimiter + terminator which allows for more
accurate/easier regexp when searching through logs

- Removes excessive std::endl (we don't need to flush for every newline)

- Now returns const type
/// @brief Human readable description of this struct
/// @param prefix for tabulations
/// @returns human readable string
std::string GetDescription(const std::string& tabs = std::string()) const;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MoroccanMalinois FYI, OOP-wise, I preferred your approach but, considering the use-case, the extra hoops we'd have to jump through to implement nested scope access to enclosed members would probably not have been in our best interest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anonimal i totally agree :)

@anonimal anonimal merged commit 39c0223 into monero-project:master Apr 17, 2017
anonimal added a commit that referenced this pull request Apr 17, 2017
39c0223 UPnP: update member/trait names from RI refactor (anonimal)
fea491d RouterInfo: refactor description getter (anonimal)
5bfdf3f RouterInfo: capabilities flag refactor (anonimal)
e09907c RouterInfo: rename member for Address' address (anonimal)
2445189 RouterInfo: rename transport member in Address class (anonimal)
65c52f5 RouterInfo: type refactor for Address/Introducer port (anonimal)
f06ae44 RouterInfo: initialize Introducer class integer members (anonimal)
6a0921d RouterInfo: enum refactor + document (anonimal)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants