Re: Foo class


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by kalpol on July 14, 2001 at 13:29:44:

In Reply to: Foo class posted by Alan Fong on July 14, 2001 at 13:00:55:

: I got the foo class in the PROJECT_TWO directory, and it is confusing to me.
:
: when we make a foo, we need 3 things:
: unsigned char process_id
: unsigned long int initializer
: unsigned long int & references

: ok. i was looking at the foo class, and are any of the fields the ones, or equivalent to the ones above?

: private:
: static int id_counter;
: static int existence_counter;
: void * creation_address;

: protected:
: int id;
: unsigned long int contents;
: void check_too_many_foos();
: void check_where_foo_is();
: public:
: static int count()
: {
: return existence_counter;
: };
: foo(unsigned long int init);

: unsigned long int accessor(unsigned long int secret);

: foo(); // creates an "empty" foo
: ~foo();
: foo(const foo &);
: foo & operator=(const foo & source);

: what are those fields anyways? does anyone care to explain?
: like what is int id? is the the process id? but the process id is an unsigned char.


He said just to assume that foohandler was called with the correct variables - your job is to take those
: unsigned char process_id
: unsigned long int initializer
: unsigned long int & references
and add a foo to them to make an identified, initialized, referenced foo. I think it's safe to assume the foo just exists so you have to figure out how to add the parameters to identify it (for example, an "array" containing a foo, initialization, pid, # of references, who they belong to, etc.)



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]