ExternalStructure.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 19 Jan 2012 11:46:00 +0000
branchjv
changeset 17911 a99f15c5efa5
parent 17910 8d796ca8bd1d
child 18022 f23232c2eaef
permissions -rw-r--r--
Updated with /trunk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
9350
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
     3
	      All Rights Reserved
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
9350
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
    14
ExternalBytes subclass:#ExternalStructure
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Support'
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
ExternalStructure class instanceVariableNames:'cType'
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
 No other class instance variables are inherited by this class.
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!ExternalStructure class methodsFor:'documentation'!
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
copyright
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 COPYRIGHT (c) 2006 by eXept Software AG
9350
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
    33
	      All Rights Reserved
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    Instances of this class represent external (non-Smalltalk) data,
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    typically C-structs or C++ instances.
9350
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
    48
    They are only useful to represent handles as returned by C functions as smalltalk objects.
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    ExternallStructures are much like ExternalBytes - however, the latter
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    allow you to access bytes via indexed at:/at:put: messages, whilst instances of subclasses of me
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    allow access via the corresponding getter/setter methods of my C-type.
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [author:]
9350
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
    55
	Claus Gittinger
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    [see also:]
9350
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
    58
	ExternalBytes ExternalAddress
7cdbea98454a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
    59
	( how to write primitive code :html: programming/primitive.html )
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
"
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
! !
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
9387
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    63
!ExternalStructure class methodsFor:'instance creation'!
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    64
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    65
fromExternalAddress:anExternalAddress
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    66
    ^ self new fromExternalAddress:anExternalAddress
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    67
! !
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    68
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!ExternalStructure class methodsFor:'queries'!
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
cType
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    ^ cType
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
! !
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
9387
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    75
!ExternalStructure methodsFor:'private'!
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    76
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    77
fromExternalAddress:anExternalAddress
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    78
    self setAddress:(anExternalAddress address) size:(anExternalAddress size).
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    79
! !
8784e3906d25 use fromExternalAddress to create structure.
ca
parents: 9350
diff changeset
    80
9343
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
!ExternalStructure class methodsFor:'documentation'!
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
0c2dcef80d03 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
version
17892
d86c8bd5ece3 Merged with CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17869
diff changeset
    84
    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStructure.st,v 1.3 2006/06/20 15:27:17 ca Exp $'
17865
598963c6ff8e Recommited from itself
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17846
diff changeset
    85
!
598963c6ff8e Recommited from itself
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17846
diff changeset
    86
598963c6ff8e Recommited from itself
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17846
diff changeset
    87
version_SVN
17911
a99f15c5efa5 Updated with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17910
diff changeset
    88
    ^ '$Id: ExternalStructure.st 10761 2012-01-19 11:46:00Z vranyj1 $'
17846
24edc476ac18 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17845
diff changeset
    89
! !
17892
d86c8bd5ece3 Merged with CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17869
diff changeset
    90
17910
8d796ca8bd1d Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
    91
17911
a99f15c5efa5 Updated with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17910
diff changeset
    92