473,794 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problemrelated to storing reference

Hi,
I have a little design related problem, and finding a good way to
resolve it.
To state the problem, I have points from writing of several documents.
Each document represents a Session class , and a SessionManager holds a
deque of Session.
Session holds deque of Page for that document. Page in turn holds
vector of Char in that page.
However Char do not hold the Point associated with that Char. Instead
it holds a pair of iterator for the points of the Char. The actual
points are stored in the Session class instead. This is done as I need
heavy processing of intercharacter points. Thus it is better to have an
linear array of Points, while Char point to to start & end in the
array. Char also contains deque of Stroke.
Now, all the relationships are bidirectional, i.e Char knows the Page,
and Page knows the Session. The other way is ofcourse known from
association.
Now I need to iterate over the points in a Stroke, or in a Char, or in
a Page.
My questions are,
1) Will I store the iterators directly in the Stroke, or Char. Or will
I store the index to the start & end point only construct the iterator
& return? (Iterator contains an extra field, the reference to the Point
array along with the start & end point).
2) If I store the start & end point only, then is it better to store
the a reference to the Point array inside the Segment, Char, Page class
etc, or to access through parent (i.e Segments parent Char, its parent
Page, its parent Session and which stores the Point array) .
3) Is it good to return a const reference of the container class from
the iterator? so that I can construct another pair of iterators from
the container? It will be helpfull if I store iterators in the Segment,
Char & Page class.
Note: I have heavy numeric calculation over Point array, and also want
to optimize memory.
Also it will be helpfull if someone suggests the standard practice.
Thanks for any kind of suggestion.

Sep 4 '06 #1
0 1442

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
11183
by: Hale | last post by:
Hi, I'm having a problem storing an array inside of a hash. I'm bringing in a hash via a reference and I want to assign a value to it. This is what I'm doing: push (@{$$node->{ELEMENTS}}, "New value"); (I need to use "push" because this is going in a for-loop)
6
2582
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a "SEGV" when run (presumably - attempt to delete deleted memory. Please take a look and see if you can notice any mistakes I'm making. Basically, I want to store classes of my objects in a vector. I also have three further questions:
12
3957
by: Alfonso Morra | last post by:
I have the ff code for testing the concept of storing objects: #include <vector> #include <iostream> using namespace std ; class MyClass { public: MyClass(){
12
4983
by: Alex D. | last post by:
is it possible? pros and cons?
2
1525
by: newjazzharmony | last post by:
All, I'd appreciate it if someone could answer these questions for me. This scenario applies to an ASP dot net application that is deployed in a web farm. 1) Does the application live in a separate app domain on each webserver in the farm? 2) Does each webserver's version of the application have its own
5
1712
by: Bryan | last post by:
I have a class 'TagType' with an ilist member 'Props' that holds a collection of another class called 'Prop'. I let the user create TagTypes and save multiple properties (Props) in them. I am having a problem storing a Prop object in a TagType object. The code below is giving me a "Object reference not set to an instance of an object." error. I don't understand why Dim t As TagType = Me.lstTagTypes.SelectedItem 'user selects TagType...
6
3200
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to me like there were performance issues at the time. How about the different types? The MS docs I would expect Access to differentiate and handle appropriately (i.e. .DOC and .XLS).. but how about ..PDF? and can I stash a .TXT document in the...
4
1347
by: =?Utf-8?B?QWxla3MgS2xleW4=?= | last post by:
When I call sub in VB I can sent value of variable or reference to this value. The question is. Suppose I have class public class AA .... end class and declare object of this class dim objAA as AA Does objAA is value or it refers to memory where I keep appropriate value. If objAA is value how I can declare it as reference?
275
12412
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.