Re: [Dev-C++] Off:Classes Access Restrictions
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2002-10-29 12:26:35
|
Slow up a second, "they" are going to be importing your class and creating
instances of it? Make sure everything is documented! lol
I think the premise of what we have so far is sound, though I believe my
method of overloading the constructors with member variables initialised to
true or false will work better than a string as you can combine the
variables to create a new kind of object.
So a superdummy could be (DummyAccess = true, NerdAccess = true)
and the function will not care what the object is named, it will just see
the value of the variable for NerdAccess. If it were a string, the function
would have to be rewritten to accomodate "superdummy"
Am I making sense anyone???
>From: André Macário Barros <ama...@uo...>
>To: Dev-C++ Mailing List <dev...@li...>
>Subject: Re: [Dev-C++] Off:Classes Access Restrictions
>Date: Tue, 29 Oct 2002 09:15:05 -0200
>
>Have no preference. But I could say that it would be better the "dummies"
>and
>"nerds" even don't know that they could make "more things" using the class
>any. Compile time maybe?
>
>Regards
>André
>
>Per Westermark wrote:
>
> > Should the access restriction be made at compile time or at run time?
> >
> > /Per W
> >
> > On Mon, 28 Oct 2002, André Macário Barros wrote:
> >
> > > Gentelmen,
> > >
> > > Sorry about the off-topic question, but let me know if you can
>help:
> > >
> > > 1. Consider the following Class
> > > Class any{
> > > public:
> > > any (int x=0, int y=0, int z=0);
> > > void dummy_func1();
> > > void not_so_dummy_func2();
> > > void very_important_func3();
> > > void only_for_bad_boys_func4();
> > > private:
> > > int x;
> > > int y;
> > > int z;
> > > };
> > >
> > > 2. Let suppose 3 different groups of users (supose programmers):
> > > "The dummies", "The Nerds", and "The Bad Boys"
> > >
> > > 3. I want to restrict the access to the public functions by group,
> > > that is, dummies programs only accessing func1, nerds programs
>accessing
> > > func1 to func3, and badboys programs accessing all the functions;
> > >
> > > 4. Is it possible do this, step 3, in C++?
> > >
> > > 5. If item 4 is possible, is it possible in Dev-C++? How?
> > >
> > > Regards
> > > André
> > >
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:ThinkGeek
> > > Welcome to geek heaven.
> > > http://thinkgeek.com/sf
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > >
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Unlimited Internet access for only $21.95/month. Try MSN!
http://resourcecenter.msn.com/access/plans/2monthsfree.asp
|