hey guys
just wondering ,is there a limit to how big a class can be?
say i write a class with 300 - 400 functions ,100 public variables and 300 private variables
is this bad?
reason i ask is because all my errors come from linking things together and passing objects to a class and it all becomes messy real fast ,but i was thinkin that one big class and everything is already linked make things easier for me in a big way
class size?
class size?
main rig: AMD64 3000+ ,1gig DDR ,ATI 9800XT ,WinXP
laptop: Intel 2.6mhz ,SiS640 gfx ,256mb DDR ,WinXP
int main()
{
irr::game(device->makegame(DOOM3);
}
laptop: Intel 2.6mhz ,SiS640 gfx ,256mb DDR ,WinXP
int main()
{
irr::game(device->makegame(DOOM3);
}
No. Not really a problem:
Member variables are accessed using a pointer and an offset - I suppose some member variables might be accessed slightly more slowly if the combined size of the class becomes bigger than, say 64k, because the offset needs more bits to be expressed in.
Member functions are not stored in the objects (class instances), so they are stored just once.
I think the only serious "threat" to performance in this is that all of the member variables are accessed a lot, and they don't all fit into the processor's caches. But you'll be hard-pressed to come up with that many member variables. You'd have to store bitmaps in the class itself (as opposed to pointers to bitmaps) to get close to that.
Member variables are accessed using a pointer and an offset - I suppose some member variables might be accessed slightly more slowly if the combined size of the class becomes bigger than, say 64k, because the offset needs more bits to be expressed in.
Member functions are not stored in the objects (class instances), so they are stored just once.
I think the only serious "threat" to performance in this is that all of the member variables are accessed a lot, and they don't all fit into the processor's caches. But you'll be hard-pressed to come up with that many member variables. You'd have to store bitmaps in the class itself (as opposed to pointers to bitmaps) to get close to that.