D - Where were gettor/settors documented?
- Russell Lewis (20/20) Oct 14 2002 For some reason, I can't find them in the docs. The online search isn't...
- Paul Runde (6/34) Oct 14 2002 The documentation for gettor/settors is in class.html, which is included...
- Jonathan Andrew (9/14) Oct 14 2002 I think properties would be great, I think they might take care of the
- Russell Lewis (5/25) Oct 14 2002 Yes, being able to add properties would be very nice. However, I was
- Jonathan Andrew (3/9) Oct 14 2002 Oh absolutely, that would be the most common usage, I was merely
For some reason, I can't find them in the docs. The online search isn't finding it, either. Also, are they implemented yet? Can I use gettors & settors to control access to a structure member without using assignment syntax? For instance, if I have this expression: struct Foo {...}; Foo foo; int x = foo.bar.baz.xyz; // throws an exception // "foo.valid.bar is false" foo.bar.baz.xyz = 3; // automatically sets foo.valid.bar = true int y = foo.bar.baz.xyz; // now this is legal I'd like to be able to define a gettors and settors that do this. The thing here is that I don't want to define gettors & settors on the "xyz" member, but on the "bar" member of the "Foo" struct. I want it such that if somebody does a "read-type" operation on any member of "bar", the gettor for "bar" is called, and if they do a "write-type" operation on any member of "bar", then the settor for "bar" is set. It's like a dynamic access-control to members. I don't expect that this is possible with current gettors & settors. Am I right? Does anybody else see any utility here?
Oct 14 2002
The documentation for gettor/settors is in class.html, which is included in the download, under the topic "Fields". Gettor/settors are listed as not being implemented in the Bugs section of alpha.html. It would be great to see them implemented. Paul Russell Lewis wrote:For some reason, I can't find them in the docs. The online search isn't finding it, either. Also, are they implemented yet? Can I use gettors & settors to control access to a structure member without using assignment syntax? For instance, if I have this expression: struct Foo {...}; Foo foo; int x = foo.bar.baz.xyz; // throws an exception // "foo.valid.bar is false" foo.bar.baz.xyz = 3; // automatically sets foo.valid.bar = true int y = foo.bar.baz.xyz; // now this is legal I'd like to be able to define a gettors and settors that do this. The thing here is that I don't want to define gettors & settors on the "xyz" member, but on the "bar" member of the "Foo" struct. I want it such that if somebody does a "read-type" operation on any member of "bar", the gettor for "bar" is called, and if they do a "write-type" operation on any member of "bar", then the settor for "bar" is set. It's like a dynamic access-control to members. I don't expect that this is possible with current gettors & settors. Am I right? Does anybody else see any utility here?
Oct 14 2002
In article <3DAADDC0.8090001 mcleodusa.net>, Paul Runde says...The documentation for gettor/settors is in class.html, which is included in the download, under the topic "Fields". Gettor/settors are listed as not being implemented in the Bugs section of alpha.html. It would be great to see them implemented. PaulI think properties would be great, I think they might take care of the "volatile" issue too. One of the big problems with not having volatile is that you need peeks and pokes all over the place. If you had some kind of property representing that physical address, you could just have a settor containing the poke, and a gettor containing a peek, and access the location just like any other variable. Just a thought. Jon
Oct 14 2002
Jonathan Andrew wrote:In article <3DAADDC0.8090001 mcleodusa.net>, Paul Runde says...Yes, being able to add properties would be very nice. However, I was looking for something a little easier (?) to implement. I was assuming that there was an underlying foo._bar object which held the actual data, and the foo.bar gettor & settor were just frontends to that.The documentation for gettor/settors is in class.html, which is included in the download, under the topic "Fields". Gettor/settors are listed as not being implemented in the Bugs section of alpha.html. It would be great to see them implemented. PaulI think properties would be great, I think they might take care of the "volatile" issue too. One of the big problems with not having volatile is that you need peeks and pokes all over the place. If you had some kind of property representing that physical address, you could just have a settor containing the poke, and a gettor containing a peek, and access the location just like any other variable. Just a thought. Jon
Oct 14 2002
Yes, being able to add properties would be very nice. However, I was looking for something a little easier (?) to implement. I was assuming that there was an underlying foo._bar object which held the actual data, and the foo.bar gettor & settor were just frontends to that.Oh absolutely, that would be the most common usage, I was merely pointing out a possible solution to the volatile problem. Jon
Oct 14 2002