OSDN Git Service

Constructor initialization and const fields
authorGlenn Kasten <gkasten@google.com>
Wed, 25 Jan 2012 23:28:08 +0000 (15:28 -0800)
committerGlenn Kasten <gkasten@google.com>
Fri, 3 Feb 2012 15:37:14 +0000 (07:37 -0800)
commit84afa3b51ac48f84ed62489529ce78cba7fca00e
treeee9ba57cdc17668c9362b70f6bfbfcbd40a253ad
parent5c0ad10b14ec2287f90f95912d98e66eef006e2a
Constructor initialization and const fields

In constructors, initialize member fields in the initialization list
rather than constructor body where possible.  This allows more fields
to be const, provided they are never modified.

Also initialize POD fields in constructor, unless it's obvious they
don't need to be initialized.  In that case, put a comment instead.

Remove explicit clear() in destructors on fields that are now const.

Give AudioSessionRef a default constructor, so it's immutable fields can
be marked const.

Add comment about ~TrackBase() trick.

Initialize fields in declaration order to make it easier to confirm that
all fields are set.

Move initialization of mHardwareStatus from onFirstRef() to constructor.

Use NULL not 0 to initialize raw pointers in initialization list.

Rename field mClient to mAudioFlingerClient, and getter from client()
to audioFlingerClient().

Change-Id: Ib36cf6ed32f3cd19003f40a5d84046eb4c122052
services/audioflinger/AudioFlinger.cpp
services/audioflinger/AudioFlinger.h
services/audioflinger/AudioMixer.cpp