Click here to Skip to main content
15,908,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [Message Deleted] Pin
Moak18-Apr-08 10:46
Moak18-Apr-08 10:46 
GeneralRe: [Message Deleted] Pin
Hamid_RT18-Apr-08 17:10
Hamid_RT18-Apr-08 17:10 
Generalany smarter ways to design this tree structure Pin
George_George17-Apr-08 23:58
George_George17-Apr-08 23:58 
GeneralOT Pin
CPallini18-Apr-08 0:30
mveCPallini18-Apr-08 0:30 
GeneralRe: OT Pin
George_George18-Apr-08 0:34
George_George18-Apr-08 0:34 
GeneralRe: OT Pin
CPallini18-Apr-08 0:53
mveCPallini18-Apr-08 0:53 
GeneralRe: OT Pin
George_George18-Apr-08 0:59
George_George18-Apr-08 0:59 
GeneralRe: any smarter ways to design this tree structure Pin
Matthew Faithfull18-Apr-08 0:58
Matthew Faithfull18-Apr-08 0:58 
Traditionally this sort of thing is done with tables, often database tables. You might have one table with every budget holder listed and their budget and then one or more consolidation tables expressing the budget grouping rules. Without knowing the details of what you're doing it's difficult to say exactly how it will work best. You could construct the same sort of logical structure with indexed lists or multi-dimensional arrays, sparse arrays if you've got a high dimensional data set.
One key thing in all cases is to identify a 'budget holder' as a type of entity whether that is always a person or sometimes a department or company or whatever. You'll find the coding works out much easier if it has some way of directly representing this key role. The next step might be to identify the set of relationship between budget holders in your complex hierarchy and then try to represent each of those relationships unambigously either as a type or in terms of a data structure.
Don't be afraid to tear up the design and start agiain a few times. I'm sure you'll soon have an efficient mapping from the real world onto a C++ class structure and back again. Good luck Smile | :)

"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)

GeneralRe: any smarter ways to design this tree structure Pin
George_George18-Apr-08 1:17
George_George18-Apr-08 1:17 
GeneralRe: any smarter ways to design this tree structure Pin
Matthew Faithfull18-Apr-08 6:42
Matthew Faithfull18-Apr-08 6:42 
GeneralRe: any smarter ways to design this tree structure Pin
George_George18-Apr-08 22:44
George_George18-Apr-08 22:44 
GeneralRe: any smarter ways to design this tree structure Pin
Matthew Faithfull19-Apr-08 11:41
Matthew Faithfull19-Apr-08 11:41 
GeneralRe: any smarter ways to design this tree structure Pin
George_George19-Apr-08 21:25
George_George19-Apr-08 21:25 
GeneralRe: any smarter ways to design this tree structure Pin
Matthew Faithfull20-Apr-08 5:31
Matthew Faithfull20-Apr-08 5:31 
GeneralRe: any smarter ways to design this tree structure Pin
George_George20-Apr-08 17:34
George_George20-Apr-08 17:34 
GeneralRe: any smarter ways to design this tree structure Pin
Matthew Faithfull21-Apr-08 9:54
Matthew Faithfull21-Apr-08 9:54 
GeneralRe: any smarter ways to design this tree structure Pin
George_George21-Apr-08 22:02
George_George21-Apr-08 22:02 
GeneralRe: any smarter ways to design this tree structure Pin
Maximilien18-Apr-08 1:04
Maximilien18-Apr-08 1:04 
GeneralRe: any smarter ways to design this tree structure Pin
George_George18-Apr-08 1:20
George_George18-Apr-08 1:20 
GeneralRe: any smarter ways to design this tree structure Pin
jhwurmbach18-Apr-08 2:11
jhwurmbach18-Apr-08 2:11 
Questioncan anybody tell me how this code works Pin
philiptabraham17-Apr-08 22:47
philiptabraham17-Apr-08 22:47 
AnswerRe: can anybody tell me how this code works [modified] Pin
CPallini17-Apr-08 22:59
mveCPallini17-Apr-08 22:59 
GeneralRe: can anybody tell me how this code works Pin
David Crow18-Apr-08 3:08
David Crow18-Apr-08 3:08 
GeneralRe: can anybody tell me how this code works Pin
CPallini18-Apr-08 4:12
mveCPallini18-Apr-08 4:12 
GeneralRe: can anybody tell me how this code works Pin
ThatsAlok18-Apr-08 5:51
ThatsAlok18-Apr-08 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.