From: Kevin M. <ke...@vr...> - 2001-09-20 15:57:44
|
found a really cool toolkit that essentially extends STL. http://www.boost.org (learn about STL at: http://www.sgi.com/tech/stl) what I found in boost that I think is especially cool was their regex library, and 4 smart ptr classes. the smart ptr called "shared_ptr" does automatic reference counting on arbitrary memory pointer you supply. This will be really nice for keeping track of shared resources in a game (sounds, images, textures, material properties, entities). When the last shared_ptr is deallocated, it automatically deletes it data ptr. nice.... no more ref() and unref(). :) if you need to ref count an array, they also have a shared_ptr for use with arrays. with the regex lib, you can parse your config and other ascii file formats with ease using regular expressions. no more buggy state machine programming! NOTE: for file formats with a hierarchy, regex isn't so good, you really need to define a grammar, which regex doesn't really do.... for this, you'd want to use something like lex and yacc (lexical analyser)... I use regex's to parse the alias|wavefront OBJ file format, and it works pretty robustly. @--@---@---@----@-----@------@------@-----@----@---@---@--@ Kevin Meinert __ _ __ http://www.vrac.iastate.edu/~kevn \ || \| \ / ` Virtual Reality Applications Center \ ||.-'|--\ Howe Hall, Iowa State University, Ames Iowa \|| \| \`__, ----------------------------------------------------------- |