| 1 |
// $Id: b_attrdata.cpp,v 1.5 2003/03/02 04:12:45 fukasawa Exp $ |
| 2 |
|
| 3 |
//============================================================================= |
| 4 |
/** |
| 5 |
* @file b_attrdata.cpp |
| 6 |
* |
| 7 |
* @author Fukasawa Mitsuo |
| 8 |
* |
| 9 |
* |
| 10 |
* Copyright (C) 2001-2004 BEE Co.,Ltd. All rights reserved. |
| 11 |
* |
| 12 |
* This program is free software; you can redistribute it and/or |
| 13 |
* modify it under the terms of the GNU General Public License |
| 14 |
* as published by the Free Software Foundation; either version 2 |
| 15 |
* of the License, or (at your option) any later version. |
| 16 |
* |
| 17 |
* This program is distributed in the hope that it will be useful, |
| 18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
* GNU General Public License for more details. |
| 21 |
* |
| 22 |
* You should have received a copy of the GNU General Public License |
| 23 |
* along with this program; if not, write to the Free Software |
| 24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 |
*/ |
| 26 |
//============================================================================= |
| 27 |
|
| 28 |
#define BEE_BUILD_DLL |
| 29 |
|
| 30 |
#include "b_attrdata.h" |
| 31 |
#include "b_objtype.h" |
| 32 |
#include "b_object.h" |
| 33 |
|
| 34 |
//----------------------------------------------------------------------------- |
| 35 |
// Constructor/Destructor |
| 36 |
//----------------------------------------------------------------------------- |
| 37 |
b_attrdata::b_attrdata(const b_object * object, const b_attribute * attr) |
| 38 |
: m_attr(const_cast<b_attribute *>(attr)), |
| 39 |
m_obj(const_cast<b_object *>(object)) |
| 40 |
{ |
| 41 |
this->set(const_cast<b_value&>(attr->getInitVal())); |
| 42 |
} |
| 43 |
|
| 44 |
//----------------------------------------------------------------------------- |
| 45 |
// Get object type |
| 46 |
//----------------------------------------------------------------------------- |
| 47 |
const b_objtype * b_attrdata::objtype() const |
| 48 |
{ |
| 49 |
TRACE_FUNCTION(TRL_LOW, "b_attribute::objtype"); |
| 50 |
|
| 51 |
return m_obj->getObjType(); |
| 52 |
} |
| 53 |
|
| 54 |
//----------------------------------------------------------------------------- |
| 55 |
// Dump |
| 56 |
//----------------------------------------------------------------------------- |
| 57 |
void b_attrdata::dump() const |
| 58 |
{ |
| 59 |
string tmpbuf = this->toString(); |
| 60 |
if (tmpbuf.size() > 512) |
| 61 |
{ |
| 62 |
tmpbuf.resize(512); |
| 63 |
tmpbuf.append(_TX("\n...... cut characters ......\n")); |
| 64 |
} |
| 65 |
ACE_DEBUG((LM_DEBUG, ACE_TEXT(" %d: %s = [%s]\n"), |
| 66 |
this->m_attr->position(), |
| 67 |
this->m_attr->name().c_str(), |
| 68 |
tmpbuf.c_str())); |
| 69 |
} |
| 70 |
|