Public Member Functions | Private Attributes

cdb_Write Class Reference
[SCSI Library]

SCSI write command. More...

#include <cdb.h>

Inheritance diagram for cdb_Write:
Inheritance graph
[legend]
Collaboration diagram for cdb_Write:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 cdb_Write ()
 cdb_Write (const UInt8_t *a_dataPtr, UInt32_t a_dataSize)
virtual ~cdb_Write ()
void SetBuffer (const UInt8_t *a_dataPtr, UInt32_t a_dataSize)
virtual const UInt8_tGetCmdPointer () const
virtual UInt32_t GetCmdSize () const
virtual Direction_e GetTransferDirection () const
virtual UInt8_tGetBufferPointer () const
virtual UInt32_t GetBufferSize () const

Private Attributes

 log_CLASSID_m
cdb_Write_t m_writeCmd
const UInt8_tm_dataPtr
UInt32_t m_dataSize

Detailed Description

SCSI write command.

Definition at line 401 of file cdb.h.


Constructor & Destructor Documentation

cdb_Write::cdb_Write (  ) 

Definition at line 47 of file cdb_write.cpp.

References m_writeCmd, and cdb_Write_t::opcode.

    : m_dataPtr(NULL),
      m_dataSize(0) {

    memset (&m_writeCmd, 0, sizeof(m_writeCmd));
    m_writeCmd.opcode = op_WRITE_6;
}

cdb_Write::cdb_Write ( const UInt8_t a_dataPtr,
UInt32_t  a_dataSize 
)

Definition at line 55 of file cdb_write.cpp.

References hton24(), m_writeCmd, cdb_Write_t::opcode, and cdb_Write_t::size.

    : m_dataPtr(a_dataPtr),
      m_dataSize(a_dataSize) {

    memset (&m_writeCmd, 0, sizeof(m_writeCmd));
    m_writeCmd.opcode = op_WRITE_6;
    m_writeCmd.size = hton24(a_dataSize);
}

Here is the call graph for this function:

cdb_Write::~cdb_Write (  )  [virtual]

Definition at line 64 of file cdb_write.cpp.

                      {
}


Member Function Documentation

UInt8_t * cdb_Write::GetBufferPointer (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 74 of file cdb_write.cpp.

References m_dataPtr.

                                           {
    return const_cast<UInt8_t*>(m_dataPtr);
}

UInt32_t cdb_Write::GetBufferSize (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 78 of file cdb_write.cpp.

References log_ERR_m, log_FUNC_m, and m_dataSize.

                                        {
    if (m_dataSize == 0) {
        log_FUNC_m(GetBufferSize);
        log_ERR_m("Request for zero bytes SCSI write.");
    }
    return m_dataSize;
}

const UInt8_t * cdb_Write::GetCmdPointer (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 86 of file cdb_write.cpp.

References m_writeCmd.

                                              {
    return reinterpret_cast<UInt8_t*>(
        const_cast<cdb_Write_t*>(&m_writeCmd) );
}

UInt32_t cdb_Write::GetCmdSize (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 91 of file cdb_write.cpp.

References m_writeCmd.

                                     {
    return sizeof(m_writeCmd);
}

Direction_e cdb_Write::GetTransferDirection (  )  const [virtual]

Implements scsi_CDB.

Definition at line 95 of file cdb_write.cpp.

                                                  {
    return TRANSFER_OUT;
}

void cdb_Write::SetBuffer ( const UInt8_t a_dataPtr,
UInt32_t  a_dataSize 
)

Definition at line 67 of file cdb_write.cpp.

References hton24(), m_dataPtr, m_dataSize, m_writeCmd, and cdb_Write_t::size.

Referenced by bea_TapeVolume::WriteRaw(), and WriteToMedium().

                                                                       {
    m_dataPtr = a_dataPtr;
    m_dataSize = a_dataSize;
    m_writeCmd.size = hton24(a_dataSize);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from scsi_CDB.

Definition at line 418 of file cdb.h.

const UInt8_t* cdb_Write::m_dataPtr [private]

Definition at line 421 of file cdb.h.

Referenced by GetBufferPointer(), and SetBuffer().

Definition at line 422 of file cdb.h.

Referenced by GetBufferSize(), and SetBuffer().

Definition at line 420 of file cdb.h.

Referenced by cdb_Write(), GetCmdPointer(), GetCmdSize(), and SetBuffer().


The documentation for this class was generated from the following files: