Hi all,
I was wondering if there's an existing library out there that supports
something along the lines of Java's ParameterList concept (look for it
in the list of classes at
http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/index.html).
The goal is as follows:
1. Have a class define inside of it parameters it needs, default
values, ranges, and validation. These parameters may be of different
types.
2. When a person instantiates an object of this class, inquire about
its list of needed parameters, and fill them where appropriate.
Thanks!
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
finlaysonc
|
12/11/2003 12:06:45 PM |
|
Hi,
> 1. Have a class define inside of it parameters it needs, default
> values, ranges, and validation. These parameters may be of different
> types.
take a look at std::map for a container type which may fit Your needs and
take a look at boost::any at www.boot.org for a generic, yet type safe
wrapper.
> 2. When a person instantiates an object of this class, inquire about
> its list of needed parameters, and fill them where appropriate.
You mean at runtime, well this requires a sort of reflextion (in
java-speak),
which is not directly supported by c++. but you can as a class always return
a list of parameters required, this again would make the class user rather
complicated.
bye
vl
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
v
|
12/12/2003 7:02:26 PM
|
|
"v" <_qquench_at_compuserve_dot_de_@news.arcor-ip.de> writes:
> Hi,
>
>> 1. Have a class define inside of it parameters it needs, default
>> values, ranges, and validation. These parameters may be of different
>> types.
>
> take a look at std::map for a container type which may fit Your needs and
> take a look at boost::any at www.boot.org for a generic, yet type safe
> wrapper.
In the sandbox we have some code and tests for Python-style named
parameter lists:
f(33, acceleration = 9.8, name = "jumper")
source: http://tinyurl.com/yzj0
test: http://tinyurl.com/yzix
No docs yet, sorry. I hope you can understand it by looking at the
test code.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
David
|
12/13/2003 2:27:47 AM
|
|
|
2 Replies
96 Views
(page loaded in 0.058 seconds)
Similiar Articles: Passing va_list by reference to a function - comp.lang.c ...Pass a variable as a macro parameter. - comp.soft-sys.sas ... Passing va_list by reference to a function - comp.lang.c ... Pass a variable as a macro parameter. - comp ... template template specialization - comp.lang.c++.moderated ...> return 0; > } Again, call_foo is a function template whose template parameter is a type. C is a template, though. This will not work. To make the main() function ... Sockets in gfortran? - comp.lang.fortranYes, when the argument 'hidden' is added to the end of the argument list for tcp_connect() in clientc.c, it receives the value 128 in my test program. Local array variables in functions - comp.lang.awkArray parameters passed to functions are passed 'by reference' in awk, and changing an array inside the function will change its origin outside the fu... ERROR IS: ORA-01007: variable not in select list - comp.databases ...> Test case name will be a static value that comes as a IN parameter of > SP. ... script I started getting "ERROR IS: ORA-01007: variable > > not in select list". building on osx - comp.compilers.lcc... usr/include/stdio.h:444, from src/c.h:5, from src/init.c:2: /usr/include/secure/_stdio.h:46: error: syntax error in macro parameter list x86-64 and calling conventions - comp.compilershow does one do things like hidden argument injection? (useful for many tasks ... used in Linux ... side, and you'd still have a problem calling C ... with the args list in a ... intent(out) for pointer dummy argument - comp.lang.fortran ...problem in interface - comp.lang.fortran The dummy arguments in the subroutine and the interface ... > I have just managed to get out of argument list mismatch. ... Change parameters using modify mvs command - comp.lang.rexx ...Hi, I am running a REXX program as a started task(batch job).(Z/OS) I want to pass parameters/commands to it using F jobname,parameters from the MV... Difference between passing a number and a variable to a subroutine ...Hi Ralph, Unlike C, Fortran passes its procedure parameters by reference. So an array literal will only work as an argument procedure declared intent (in). Parameter declarations - IBM - United StatesThe function declarator includes the list of parameters that can be passed to the function when it is called by another function, or by itself. Parameters (C) - Microsoft Corporation: Software, Smartphones ...Arguments are names of values passed to a function by a function call. Parameters are the values the function expects to receive. In a function prototype, the ... 7/23/2012 11:34:47 AM
|