Forward declaration Of Data 
Author Message
 Forward declaration Of Data

This has  me not stumped but in need of a few extra minds.

I have an Object which has a Data Member called Data, which has to be
written and read from a file. So in order to do this I need to know the
record type of the data.

There are a number of objects that use common member functions and I want
to create an abstract type that handle the basic read ans write and lcok
etc and the decended types just handle all the data manipulation.

But how?

Normally I could define a new abstact class and use virtul read/write
member functions. The problem is that read an write are not the only
functions that need to know the record type being manipulated, since the
object is a Tlistviewer  decendant with some serious modifications. Since
BP7 has no RTTI I can't determine the datatype at runtime.

One solution is to have a Data Memeber of type Pointer and the decendants
just set the pointer to the data record in use, but again when I write or
read  have to know the record type.

One solution is to use objects for my data, but I can't because the
TurboPower library I am using won't let me. I'm written an OOP wrapper
round a lot of the Library functions but this is where I find this problem.

I can solve the problem by virtual reead and write member, but since
this is on a network system and the way the TurboPower libraby works I
MUST use several different procedurtes to get or put records depending on
the access required and the the resulting  function that must be called.

If this is a bad explanation, please accept my apologies, it's just hard
to explain :)

Anyone with any word of wisdom ?

TIA

Chris



Wed, 18 Jun 1902 08:00:00 GMT  
 Forward declaration Of Data

Quote:

>This has  me not stumped but in need of a few extra minds.
>I have an Object which has a Data Member called Data, which has to be
>written and read from a file. So in order to do this I need to know the
>record type of the data.
>There are a number of objects that use common member functions and I want
>to create an abstract type that handle the basic read ans write and lcok
>etc and the decended types just handle all the data manipulation.
>But how?
>Normally I could define a new abstact class and use virtul read/write
>member functions. The problem is that read an write are not the only
>functions that need to know the record type being manipulated, since the
>object is a Tlistviewer  decendant with some serious modifications. Since
>BP7 has no RTTI I can't determine the datatype at runtime.
>One solution is to have a Data Memeber of type Pointer and the decendants
>just set the pointer to the data record in use, but again when I write or
>read  have to know the record type.
>One solution is to use objects for my data, but I can't because the
>TurboPower library I am using won't let me. I'm written an OOP wrapper
>round a lot of the Library functions but this is where I find this problem.
>I can solve the problem by virtual reead and write member, but since
>this is on a network system and the way the TurboPower libraby works I
>MUST use several different procedurtes to get or put records depending on
>the access required and the the resulting  function that must be called.
>If this is a bad explanation, please accept my apologies, it's just hard
>to explain :)
>Anyone with any word of wisdom ?
>TIA
>Chris

Hi

If I got you right you want to do something like

Object Common  -> read/write
 |          |
Object A   Object B  ->  other data manipulation

what about making Data member pointer and introducing another member -
DataSize (will be set by decendants), then in Read/Write method you
just call BlockRead(..)?

Cheers
  Dmitri

--------------------------------------------------------------
        Shit happens, but why it always happens to us?
--------------------------------------------------------------

                            http://www.dma.be/p/bewoner/dmitri



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help on Remote Site Data Forwarding to Central Location

2. Pointer declarations

3. Variant fields in object declaration in TP7 or DELPHI

4. declaration error

5. Program name declaration

6. ODBC32 API Declaration Unit for Delphi 2.0

7. {10:3 declaration}????

8. write / writeln declaration

9. Help: Unfamiliar type declaration

10. Help: Unfamiliar type declaration

11. Dynamic array declaration

12. What does this Declaration mean?

 

 
Powered by phpBB® Forum Software