Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_AttLong_i.cxx
1 using namespace std;
2 //  File      : SALOMEDS_AttLong_i.cxx
3 //  Created   : Mon Jun 10 10:54:58 CEST 2002 
4 //  Author    : Estelle Deville
5
6 //  Project   : SALOME
7 //  Module    : SALOMEDS
8 //  Copyright : CEA 2002
9 //  $Header$
10
11
12
13 #include "SALOMEDS_AttLong_i.hxx"
14 #include "utilities.h"
15 #include <TDF_Tool.hxx>
16 #include <stdio.h>
17
18 //============================================================================
19 /*! Function : Set
20  *  Purpose  : Affect a value to the basic attribute
21  */
22 //============================================================================
23 void SALOMEDS_AttLong_i::Set(CORBA::Long i)
24 {
25   CheckLocked();
26   TDataStd_Integer::Set (_Lab,i);
27 }
28
29 //============================================================================
30 /*! Function : Get
31  *  Purpose  : Get basic attribute's value
32  */
33 //============================================================================
34 CORBA::Long SALOMEDS_AttLong_i::Get()
35 {
36   Handle(TDataStd_Integer) Att;
37   CORBA::Long x;
38   if (_Lab.FindAttribute(TDataStd_Integer::GetID(),Att))
39     x = Att->Get ();
40   return x;
41 }
42
43 //============================================================================
44 /*! Function : Save
45  *  Purpose  : 
46  */
47 //============================================================================
48 char* SALOMEDS_AttLong_i::Save()
49 {
50   BEGIN_OF("SALOMEDS_AttLong_i::Save");
51   CORBA::Long x = this->Get();
52   char* out= new char[12];
53   sprintf(out,"%ld",x);
54   return out; 
55 }
56
57 //============================================================================
58 /*! Function : Load
59  *  Purpose  : 
60  */
61 //============================================================================
62 void SALOMEDS_AttLong_i::Load()
63 {
64   BEGIN_OF("SALOMEDS_AttLong_i::Load");
65 }
66
67 //============================================================================
68 /*! Function : GetPtr
69  *  Purpose  : return sobject associated to the basic attribute (if exist)
70  */
71 //============================================================================
72 CORBA::Boolean SALOMEDS_AttLong_i::GetPtr(SALOMEDS::SObject_ptr anObject)
73 {
74   Handle(TDataStd_Integer) Att;
75   return _Lab.FindAttribute(TDataStd_Integer::GetID(),Att);
76 }
77
78 //============================================================================
79 /*! Function : GetType
80  *  Purpose  : 
81  */
82 //============================================================================
83 char* SALOMEDS_AttLong_i::GetType()
84 {
85   return CORBA::string_dup(_type);
86 }