Skip to main content
Numbered list to numbered list. Remove 'thanks' and 'help' from end.
Source Link
user40980
user40980

I need your help how to implement it nice and well. It's quite a simple problem. I can solve it but I need help on how to do that better.

My class has logic working using three parameters. It gets them from another class. The problem is:

  1. the first parameter is enum (it's required)

  2. the second parameter is another enum (it's optional - there is possibility that this parameter doesn't exist)

  3. the third parameter is vector of other enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, e.g. updateParameters(...).

Maybe I should have overloaded methods for every possibility, but it's not nice I guess. I can't get some container with parameters because I have different types.

Please help me.

Thanks

I need your help how to implement it nice and well. It's quite a simple problem. I can solve it but I need help on how to do that better.

My class has logic working using three parameters. It gets them from another class. The problem is:

  1. the first parameter is enum (it's required)

  2. the second parameter is another enum (it's optional - there is possibility that this parameter doesn't exist)

  3. the third parameter is vector of other enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, e.g. updateParameters(...).

Maybe I should have overloaded methods for every possibility, but it's not nice I guess. I can't get some container with parameters because I have different types.

Please help me.

Thanks

I need your help how to implement it nice and well. It's quite a simple problem. I can solve it but I need help on how to do that better.

My class has logic working using three parameters. It gets them from another class. The problem is:

  1. the first parameter is enum (it's required)

  2. the second parameter is another enum (it's optional - there is possibility that this parameter doesn't exist)

  3. the third parameter is vector of other enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, e.g. updateParameters(...).

Maybe I should have overloaded methods for every possibility, but it's not nice I guess. I can't get some container with parameters because I have different types.

Tweeted twitter.com/#!/StackProgrammer/status/427841504984707072
Fixed grammar and retagged
Source Link
superM
  • 7.4k
  • 4
  • 31
  • 39

I need your help how to implement it nice and well. It's quite a simple problem. I can solve it but iI need help on how to do that the bestbetter. (Language: C++)

My class has logic workedworking using three parameters. It gets them from otheranother class. The problem is:

  1. 1 of parametersthe first parameter is enum (it's required)

  2. 2 of parametersthe second parameter is otheranother enum (it's optional - there is possibility that this parameter doesn't exist)

  3. 3 of parametersthe third parameter is vector of anotherother enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, ex. updateParameters(.e.g.) updateParameters(...).

Maybe I should overload method...have overloaded methods for every possibilypossibility, but it's not nice I guess... I can't get some container with parameters because I have different types...

Please help me.

Thanks

I need your help how to implement it nice and well. It's quite simple problem. I can solve it but i need help how to do that the best. (Language: C++)

My class has logic worked using three parameters. It gets them from other class. The problem is:

  1. 1 of parameters is enum (it's required)

  2. 2 of parameters is other enum (it's optional - there is possibility that this parameter doesn't exist)

  3. 3 of parameters is vector of another enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, ex. updateParameters(...).

Maybe I should overload method... for every possibily but it's not nice I guess... I can't get some container with parameters because I have different types...

Please help me.

Thanks

I need your help how to implement it nice and well. It's quite a simple problem. I can solve it but I need help on how to do that better.

My class has logic working using three parameters. It gets them from another class. The problem is:

  1. the first parameter is enum (it's required)

  2. the second parameter is another enum (it's optional - there is possibility that this parameter doesn't exist)

  3. the third parameter is vector of other enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, e.g. updateParameters(...).

Maybe I should have overloaded methods for every possibility, but it's not nice I guess. I can't get some container with parameters because I have different types.

Please help me.

Thanks

Source Link

How to deliver 3 different parameters to class in one method (2 of 3 are optional)

I need your help how to implement it nice and well. It's quite simple problem. I can solve it but i need help how to do that the best. (Language: C++)

My class has logic worked using three parameters. It gets them from other class. The problem is:

  1. 1 of parameters is enum (it's required)

  2. 2 of parameters is other enum (it's optional - there is possibility that this parameter doesn't exist)

  3. 3 of parameters is vector of another enums (it's optional - there is possibility that this parameter doesn't exist).

How to handle these parameters to my class?

Any ideas?

I'd like to get these parameters in one method, ex. updateParameters(...).

Maybe I should overload method... for every possibily but it's not nice I guess... I can't get some container with parameters because I have different types...

Please help me.

Thanks