OSB_LIB::Address Class Reference

Collaboration diagram for OSB_LIB::Address:

Collaboration graph
[legend]
List of all members.

Detailed Description

In OSB an Associate can have one or many addresses.

In normal operation an existing address must not be changed, instead a new address should be created (and subsequently stored in the database). The only business case where the above is not true is the situation where an address is corrected (typo or missunder standing).

Remarks:
Copy constructor, assignment and destructor by compiler.

Definition at line 102 of file address.h.

Public Types

Public Member Functions

Read access to data members
Modify data members

Private Member Functions

Private Attributes

Friends


Member Typedef Documentation

typedef Id<Associate> OSB_LIB::Address::OwnerId

The id of the address' owner.

Definition at line 110 of file address.h.

typedef std::set<AddressType> OSB_LIB::Address::TypeList

STL containter used to store the type.

Definition at line 114 of file address.h.


Constructor & Destructor Documentation

OSB_LIB::Address::Address ( const OwnerId ownerId,
const TypeList types 
)

Constructor only with owner id and type.


Member Function Documentation

const std::string & OSB_LIB::Address::addressee (  )  const [inline]

Definition at line 422 of file address.h.

References addressee_.

bool OSB_LIB::Address::addType ( const OSB_DB::Session session,
AddressType  type 
) [private]

Add a new type for this address.

This will duplicate the address with different type. That is the two or more types will share the same address.

Parameters:
session Database session to use.
type The new type to be added.
Returns:
True if it is successful.

const std::string & OSB_LIB::Address::city (  )  const [inline]

Definition at line 432 of file address.h.

References city_.

bool OSB_LIB::Address::contains ( AddressType  type  )  const [private]

Find whether the given type exists in this address.

Parameters:
type The type to search for.
Returns:
True if it exists, false for not found

const std::string & OSB_LIB::Address::country (  )  const [inline]

Definition at line 447 of file address.h.

References country_.

bool OSB_LIB::Address::delType ( const OSB_DB::Session session,
AddressType  type 
) [private]

Delete a type from this address.

This will delete the type from the shared address. If this type of address is the separate one return false.

Parameters:
session Database session to use.
type The new type to be added.
Returns:
True if it is successful.
Exceptions:
OsbException 
  • as specified by the gateway class.

const std::string & OSB_LIB::Address::email (  )  const [inline]

Definition at line 457 of file address.h.

References email_.

const std::string & OSB_LIB::Address::faxNum (  )  const [inline]

Definition at line 462 of file address.h.

References faxNum_.

const std::string & OSB_LIB::Address::function (  )  const [inline]

Definition at line 467 of file address.h.

References function_.

bool OSB_LIB::Address::insert ( const OSB_DB::Session session  )  const [private]

Insert an address to the database.

Parameters:
session Database session to use, transactions are not commited.
Returns:
True if the address was inserted into the database.
Exceptions:
OsbException 
  • as specified by the gateway class.

const Address::OwnerId & OSB_LIB::Address::ownerId (  )  const [inline]

Definition at line 412 of file address.h.

References ownerId_.

bool OSB_LIB::Address::remove ( const OSB_DB::Session session  )  const [private]

Delete an address from the database.

Parameters:
session Database session to use, transactions are not commited.
Returns:
True if the address was updated to the database.
Exceptions:
OsbException 
  • as specified by the gateway class.

void OSB_LIB::Address::setAddressee ( const std::string &  addressee  ) 

void OSB_LIB::Address::setCity ( const std::string &  city  ) 

void OSB_LIB::Address::setCountry ( const std::string &  country  ) 

void OSB_LIB::Address::setEmail ( const std::string &  email  ) 

void OSB_LIB::Address::setFaxNum ( const std::string &  fax  ) 

void OSB_LIB::Address::setFunction ( const std::string &  function  ) 

void OSB_LIB::Address::setState ( const std::string &  state  ) 

void OSB_LIB::Address::setStreet ( const std::string &  street  ) 

void OSB_LIB::Address::setTelNum ( const std::string &  tel  ) 

void OSB_LIB::Address::setZipcode ( const std::string &  zip  ) 

const std::string & OSB_LIB::Address::state (  )  const [inline]

Definition at line 437 of file address.h.

References state_.

const std::string & OSB_LIB::Address::street (  )  const [inline]

Definition at line 427 of file address.h.

References street_.

const std::string & OSB_LIB::Address::telNum (  )  const [inline]

Definition at line 452 of file address.h.

References telNum_.

const Address::TypeList & OSB_LIB::Address::types (  )  const [inline]

Definition at line 417 of file address.h.

References types_.

bool OSB_LIB::Address::update ( const OSB_DB::Session session  )  const [private]

Update an address to the database.

Parameters:
session Database session to use, transactions are not commited.
Returns:
True if the address was updated to the database.
Exceptions:
OsbException 
  • as specified by the gateway class.

const std::string & OSB_LIB::Address::zipcode (  )  const [inline]

Definition at line 442 of file address.h.

References zipcode_.


Friends And Related Function Documentation

friend class Associate [friend]

Provide access ot types_ and database operations.

Definition at line 106 of file address.h.

friend class OSB_DB::AddressGw [friend]

Allow to set data members when reading from database.

Definition at line 104 of file address.h.


Member Data Documentation

std::string OSB_LIB::Address::addressee_ [private]

addressee of Address

Definition at line 229 of file address.h.

Referenced by addressee().

std::string OSB_LIB::Address::city_ [private]

city

Definition at line 231 of file address.h.

Referenced by city().

std::string OSB_LIB::Address::country_ [private]

country

Definition at line 234 of file address.h.

Referenced by country().

std::string OSB_LIB::Address::email_ [private]

Email address.

Definition at line 236 of file address.h.

Referenced by email().

std::string OSB_LIB::Address::faxNum_ [private]

fax number

Definition at line 237 of file address.h.

Referenced by faxNum().

std::string OSB_LIB::Address::function_ [private]

function

Definition at line 238 of file address.h.

Referenced by function().

OwnerId OSB_LIB::Address::ownerId_ [private]

id of Associate

Definition at line 227 of file address.h.

Referenced by ownerId().

std::string OSB_LIB::Address::state_ [private]

state

Definition at line 232 of file address.h.

Referenced by state().

std::string OSB_LIB::Address::street_ [private]

street

Definition at line 230 of file address.h.

Referenced by street().

std::string OSB_LIB::Address::telNum_ [private]

telephone number

Definition at line 235 of file address.h.

Referenced by telNum().

TypeList OSB_LIB::Address::types_ [private]

list of AddressType

Definition at line 228 of file address.h.

Referenced by types().

std::string OSB_LIB::Address::zipcode_ [private]

zip

Definition at line 233 of file address.h.

Referenced by zipcode().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:10:36 2006 for OSB Library by  doxygen 1.4.7