---
name: "ACE_Locked_Data_Block"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Locked_Data_Block"
---

# ACE\_Locked\_Data\_Block(3)

A Data\_Block with a concrete locking strategy.

## NAME

ACE\_Locked\_Data\_Block -  A Data\_Block with a concrete locking strategy.

## SYNOPSIS

```
#include <ace/Message_Block_T.h>
template<class ACE_LOCK>
class ACE_Locked_Data_Block : public ACE_Data_Block
{
  public:
    ACE_Locked_Data_Block (void);
    ACE_Locked_Data_Block (
        size_t size,
        ACE_Message_Block::ACE_Message_Type msg_type,
        const char *msg_data,
        ACE_Allocator *allocator_strategy,
        ACE_Message_Block::Message_Flags flags,
        ACE_Allocator *data_block_allocator
        );
    virtual ~ACE_Locked_Data_Block (void);
    virtual ACE_Data_Block *clone_nocopy (
        ACE_Message_Block::Message_Flags mask = 0
        ) const;
  private:
    ACE_LOCK lock_;
    inline ACE_UNIMPLEMENTED_FUNC (
        ACE_Locked_Data_Block<ACE_LOCK> &operator= (const ACE_Locked_Data_Block<ACE_LOCK> &)
        );
};
```

## DESCRIPTION

Data\_Blocks can be parametric on the kind of lock they use; in many cases the lifetime of the lock is tied to the lifetime of the Data\_Block itself. But since Data\_Blocks are reference counted it is hard for users to control the lock lifetime. This class is parametric over the kind of lock used.

## Initialization and termination methods.

```
ACE_Locked_Data_Block (void);
```

Default "do-nothing" constructor.

```
ACE_Locked_Data_Block (
    size_t size,
    ACE_Message_Block::ACE_Message_Type msg_type,
    const char *msg_data,
    ACE_Allocator *allocator_strategy,
    ACE_Message_Block::Message_Flags flags,
    ACE_Allocator *data_block_allocator
    );
```

Initialize.

```
virtual ~ACE_Locked_Data_Block (void);
```

Delete all the resources held in the message.

```
virtual ACE_Data_Block *clone_nocopy (
    ACE_Message_Block::Message_Flags mask = 0
    ) const;
```

Return an exact "deep copy" of the message, the dynamic type is ACE\_Locked\_Data\_Block See the documentation in Message\_Block.h for details.

## Disallow these operations.

```
inline ACE_UNIMPLEMENTED_FUNC (
    ACE_Locked_Data_Block<ACE_LOCK> &operator= (const ACE_Locked_Data_Block<ACE_LOCK> &)
    );
```

## AUTHOR

Doug Schmidt & Carlos O'Ryan

## LIBRARY

ace
