Replies: 11 comments
-
Unfortunately there is not the 😭 reaction. 😬 I totally agree to remove these hardcoded checks and define functions to the carrier level. In another carrier that I worked to, I do this check inside the carrier itself during the initial handshake. |
Beta Was this translation helpful? Give feedback.
-
what about:
|
Beta Was this translation helpful? Give feedback.
-
Sounds good, but I always have doubts about |
Beta Was this translation helpful? Give feedback.
-
After a quick search, I'd say that |
Beta Was this translation helpful? Give feedback.
-
I think we should also specify in the documentation the exact meaning of these, because they are already confusing to me...
|
Beta Was this translation helpful? Give feedback.
-
Right. Is there the need to also specify that a protocol is |
Beta Was this translation helpful? Give feedback.
-
// Carrier.h
/**
* Returns true if this carrier works only between 2 ports on the same process
*/
bool interProcessOnly() = 0; // { return false; } in AbstractCarrier, reimplemented in local carrier
/**
* Returns true if this carrier works only between 2 ports on the same host
*/
bool interHostOnly() = 0; // { return false; } in AbstractCarrier, reimplemented in shmem carrier Or perhaps something like this would be better enum class Foo
{
None = 0,
IntraProcess,
IntraHost,
Any
};
Foo aSignificantMethodName()
{
return Foo::Any;
} or also (over-engineering?) enum class Foo
{
None = 0,
WorksIntraProcess = 0x0001,
WorksIntraHost = 0x0002,
WorksInterHost = 0x0004,
IntraProcessOnly = WorksIntraProcess,
IntraHostOnly = WorksIntraProcess | WorksIntraHost,
Any = WorksIntraProcess | WorksIntraHost | WorksInterHost
};
Foo aSignificantMethodName()
{
return Foo::Any;
} |
Beta Was this translation helpful? Give feedback.
-
Personally, I'd prefer the first option. More clear and I get directly the info I want.
Or maybe |
Beta Was this translation helpful? Give feedback.
-
The second option has the advantage that it makes the options mutually exclusive, whereas in the first case you have to explicitly make sure that a carrier does not return true on both. |
Beta Was this translation helpful? Give feedback.
-
I was wandering exactly about that. |
Beta Was this translation helpful? Give feedback.
-
As discussed with @lornat75, we are proposing to use this naming: enum class Foo
{
None = 0,
WorksIntraProcess = 0x0001,
WorksIntraHost = 0x0002,
WorksInterHost = 0x0004,
IntraProcess = WorksIntraProcess
IntraHostOnly = WorksIntraHost,
IntraHost = WorksIntraProcess | WorksIntraHost,
InterHostOnly = WorksInterHost,
InterHost = WorksIntraProcess | WorksIntraHost | WorksInterHost
}; |
Beta Was this translation helpful? Give feedback.
-
YARP is supposed to be agnostic about which carrier is currently used, but in some places the carrier name is checked. For example:
yarp/src/libYARP_OS/src/NameServer.cpp
Lines 367 to 377 in 290545d
In this example
local
andshmem
are checked explicitly, but this will not work for any other carrier.I think we should add 2 methods to the
Carrier
interface that allows to perform this check, something likesameProcessOnly()
, andsameSystemOnly()
both returning to false if not explicitly implemented in the carrier (Any suggestion on the naming is welcome).I'm not really sure if this is ok though, since this part will run (I think) on the yarpserver, and it could be running on a machine where the carrier is not available. For example imagine a that we had a carrier that runs only on windows, and the yarp server is running on linux... How can we handle this?
There are other hardcoded carrier names (mostly
tcp
), we should also investigate those.Beta Was this translation helpful? Give feedback.
All reactions